Skip to content

Commit

Permalink
Rollup merge of rust-lang#53311 - RalfJung:windows-mutex, r=retep998
Browse files Browse the repository at this point in the history
Window Mutex: Document that we properly initialize the SRWLock

See rust-lang#35836
  • Loading branch information
kennytm authored Aug 24, 2018
2 parents 63d6649 + b7a49e7 commit ab5a71b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libstd/sys/windows/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub unsafe fn raw(m: &Mutex) -> c::PSRWLOCK {
impl Mutex {
pub const fn new() -> Mutex {
Mutex {
// This works because SRWLOCK_INIT is 0 (wrapped in a struct), so we are also properly
// initializing an SRWLOCK here.
lock: AtomicUsize::new(0),
held: UnsafeCell::new(false),
}
Expand Down

0 comments on commit ab5a71b

Please sign in to comment.