diff --git a/tokio-sync/src/lock.rs b/tokio-sync/src/lock.rs index b6153800f..2f8b32f88 100644 --- a/tokio-sync/src/lock.rs +++ b/tokio-sync/src/lock.rs @@ -72,9 +72,11 @@ pub struct Lock { #[derive(Debug)] pub struct LockGuard(Lock); -// As long as T: Send, it's fine to send Lock to other threads. -// If T was not Send, sending a Lock would be bad, since you can access T through Lock. +// As long as T: Send, it's fine to send and share Lock between threads. +// If T was not Send, sending and sharing a Lock would be bad, since you can access T through +// Lock. unsafe impl Send for Lock where T: Send {} +unsafe impl Sync for Lock where T: Send {} unsafe impl Sync for LockGuard where T: Send + Sync {} #[derive(Debug)]