about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-08-24 16:44:30 +0800
committerGitHub <noreply@github.com>2018-08-24 16:44:30 +0800
commitab5a71b0347bbcb66152210a5c358908972534c6 (patch)
treecd5e0355230e3434360c759b335c3020bd564c11 /src/libstd/sys/windows
parent63d66494aff57411bfec1dd2a3a5f1af900feab6 (diff)
parentb7a49e7c9e720039f3d2c54a38be73126d052d09 (diff)
downloadrust-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.rs2
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),
         }