diff options
| author | kennytm <kennytm@gmail.com> | 2018-08-24 16:44:30 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-24 16:44:30 +0800 |
| commit | ab5a71b0347bbcb66152210a5c358908972534c6 (patch) | |
| tree | cd5e0355230e3434360c759b335c3020bd564c11 /src/libstd/sys/windows | |
| parent | 63d66494aff57411bfec1dd2a3a5f1af900feab6 (diff) | |
| parent | b7a49e7c9e720039f3d2c54a38be73126d052d09 (diff) | |
| download | rust-ab5a71b0347bbcb66152210a5c358908972534c6.tar.gz rust-ab5a71b0347bbcb66152210a5c358908972534c6.zip | |
Rollup merge of #53311 - RalfJung:windows-mutex, r=retep998
Window Mutex: Document that we properly initialize the SRWLock See https://github.com/rust-lang/rust/issues/35836
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/mutex.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs index 9bf9f749d4d..b0e7331e2b6 100644 --- a/src/libstd/sys/windows/mutex.rs +++ b/src/libstd/sys/windows/mutex.rs @@ -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), } |
