Skip to content

Commit c223257

Browse files
authored
Clarify how MutexGuard is 'thread-safe' (avoiding the vague term) (#2336)
Fixes the last outstanding point of #1640.
1 parent 345e782 commit c223257

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/concurrency/send-sync/examples.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ Typically because of interior mutability:
3030

3131
## `!Send + Sync`
3232

33-
These types are thread-safe, but they cannot be moved to another thread:
33+
These types are safe to access (via shared references) from multiple threads,
34+
but they cannot be moved to another thread:
3435

3536
- `MutexGuard<T: Sync>`: Uses OS level primitives which must be deallocated on
36-
the thread which created them.
37+
the thread which created them. However, an already-locked mutex can have its
38+
guarded variable read by any thread with which the guard is shared.
3739

3840
## `!Send + !Sync`
3941

0 commit comments

Comments
 (0)