Skip to content

Commit 8a72954

Browse files
committed
Window Mutex: make sure we properly initialize the SRWLock
1 parent 0aa8d03 commit 8a72954

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 a NULL pointer, 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)