File tree 1 file changed +3
-4
lines changed
library/std/src/sys/windows
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,8 @@ impl Mutex {
135
135
n => return n as * const _ ,
136
136
}
137
137
unsafe {
138
- let inner = box Inner { remutex : ReentrantMutex :: uninitialized ( ) , held : Cell :: new ( false ) } ;
138
+ let inner =
139
+ box Inner { remutex : ReentrantMutex :: uninitialized ( ) , held : Cell :: new ( false ) } ;
139
140
inner. remutex . init ( ) ;
140
141
let inner = Box :: into_raw ( inner) ;
141
142
match self . lock . compare_and_swap ( 0 , inner as usize , Ordering :: SeqCst ) {
@@ -182,9 +183,7 @@ impl ReentrantMutex {
182
183
#[ inline]
183
184
pub unsafe fn try_lock ( & self ) -> bool {
184
185
// SAFETY: The caller must ensure that the mutex is not moved or copied
185
- unsafe {
186
- c:: TryEnterCriticalSection ( UnsafeCell :: raw_get ( self . inner . as_ptr ( ) ) ) != 0
187
- }
186
+ unsafe { c:: TryEnterCriticalSection ( UnsafeCell :: raw_get ( self . inner . as_ptr ( ) ) ) != 0 }
188
187
}
189
188
190
189
pub unsafe fn unlock ( & self ) {
You can’t perform that action at this time.
0 commit comments