I recently encountered the example of certain locks being !Send
, because the thread that unlocks a mutex or rw-lock must be (depending on implementation) the same thread which locked it. Thus, you cannot "send" a future that holds such a lock guard to a different thread. (Note: You still can use other locks that are "thread-safe" in an async context, such as tokio::sync::Mutex
.)
This isn't related to synchronizing access to memory at all, but has to do with the operating system's API, in this example.