phip1611
phip1611

Reputation: 6140

Are there valid implementations of the Sync trait apart from the Rust standard library?

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

Answers (1)

Wesley Wiser
Wesley Wiser

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

Related Questions