In Rust, if I have a type that is not safe to send between threads, I wrap it with
Arc<Mutex<T>>. This way I'm guaranteed that when I access it, I need to unlock it first. However, Rust still complains when
SomeType does not implement
Send + Sync.
Shoudln't it work for any type? In my case,
SomeType is a struct that accesses a C object through FFI, so I cannot mark it as
Sync + Send.
What can I do in this case and why Rust wont accept
Arc<Mutex<SomeType>> as safe to share between threads?