Reputation: 6140
Sync
and Send
are part of the language. Arc
and Mutex
are part of the standard library and both implement Send
and Sync
. Are there structures apart from the standard library (std::sync
) (e.g in some crates) that do something like unsafe impl Sync for SomeStruct {}
for valid reasons? In my humble understanding no developer will ever need implementations of Sync
except the ones developing the standard library.
Upvotes: 2
Views: 226
Reputation: 9851
Yes, crossbeam
, a crate which provides "tools for concurrent programming in Rust", for example has an unsafe impl Sync for AtomicCell
.
Upvotes: 5