Skip to content

Commit ab5a71b

Browse files
authored
Rollup merge of rust-lang#53311 - RalfJung:windows-mutex, r=retep998
Window Mutex: Document that we properly initialize the SRWLock See rust-lang#35836
2 parents 63d6649 + b7a49e7 commit ab5a71b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/sys/windows/mutex.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ pub unsafe fn raw(m: &Mutex) -> c::PSRWLOCK {
5858
impl Mutex {
5959
pub const fn new() -> Mutex {
6060
Mutex {
61+
// This works because SRWLOCK_INIT is 0 (wrapped in a struct), so we are also properly
62+
// initializing an SRWLOCK here.
6163
lock: AtomicUsize::new(0),
6264
held: UnsafeCell::new(false),
6365
}

0 commit comments

Comments
 (0)