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 there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that SharedMutex implements Send and Sync so long as the contained type is Sync:
However, this should be Send + Sync bound just like the standard library's Mutex requires Send. There are some types such as MutexGuard which are safe to use across threads but can't be sent (in the case of MutexGuard this is because it's undefined behavior to acquire and free a lock from a different thread). There's more examples here: https://users.rust-lang.org/t/sync-but-not-send/21551
The text was updated successfully, but these errors were encountered:
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that
SharedMutex
implementsSend
andSync
so long as the contained type isSync
:rust-shared-mutex/src/lib.rs
Lines 37 to 38 in f289000
However, this should be
Send + Sync
bound just like the standard library'sMutex
requiresSend
. There are some types such asMutexGuard
which are safe to use across threads but can't be sent (in the case ofMutexGuard
this is because it's undefined behavior to acquire and free a lock from a different thread). There's more examples here: https://users.rust-lang.org/t/sync-but-not-send/21551The text was updated successfully, but these errors were encountered: