diff options
| author | Ralf Jung <post@ralfj.de> | 2018-08-13 21:15:42 +0200 | 
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-08-13 22:45:13 +0200 | 
| commit | 8a72954d7a900736ce85f05cfa8c0df1c013acaa (patch) | |
| tree | 4ed17830b8f29f1dfd0d3bd210ae7a5650720251 /src/libstd/sys/windows/mutex.rs | |
| parent | 0aa8d0320266b5579428312095fe49af05ada972 (diff) | |
| download | rust-8a72954d7a900736ce85f05cfa8c0df1c013acaa.tar.gz rust-8a72954d7a900736ce85f05cfa8c0df1c013acaa.zip  | |
Window Mutex: make sure we properly initialize the SRWLock
Diffstat (limited to 'src/libstd/sys/windows/mutex.rs')
| -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..58f24eb1323 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 a NULL pointer, so we are also properly + // initializing an SRWLOCK here. lock: AtomicUsize::new(0), held: UnsafeCell::new(false), }  | 
