You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was randomly browsing your repo and the line
GLOBAL_CALLBACK = Some(Box::new(callback));
struck me. There's no synchronization when modifying this static mut and it's code directly reachable from client code, making it thread unsafe.
I'd recommend to add a mutex or mark that function unsafe. If you plan to keep it safe, I'd also recommend making sure the raw_callback is aware of callback change too. Checking if this idiom isn't used incorrectly elsewhere might help too.
The text was updated successfully, but these errors were encountered:
Hi, I was randomly browsing your repo and the line
struck me. There's no synchronization when modifying this static mut and it's code directly reachable from client code, making it thread unsafe.
I'd recommend to add a mutex or mark that function unsafe. If you plan to keep it safe, I'd also recommend making sure the
raw_callback
is aware of callback change too. Checking if this idiom isn't used incorrectly elsewhere might help too.The text was updated successfully, but these errors were encountered: