File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -172,27 +172,19 @@ impl ReentrantMutex {
172172 }
173173
174174 pub unsafe fn lock ( & self ) {
175- // `init` must have been called, so this is now initialized and
176- // we can call `get_mut`.
177- c:: EnterCriticalSection ( ( & mut * self . inner . get ( ) ) . get_mut ( ) ) ;
175+ c:: EnterCriticalSection ( ( & mut * self . inner . get ( ) ) . as_mut_ptr ( ) ) ;
178176 }
179177
180178 #[ inline]
181179 pub unsafe fn try_lock ( & self ) -> bool {
182- // `init` must have been called, so this is now initialized and
183- // we can call `get_mut`.
184- c:: TryEnterCriticalSection ( ( & mut * self . inner . get ( ) ) . get_mut ( ) ) != 0
180+ c:: TryEnterCriticalSection ( ( & mut * self . inner . get ( ) ) . as_mut_ptr ( ) ) != 0
185181 }
186182
187183 pub unsafe fn unlock ( & self ) {
188- // `init` must have been called, so this is now initialized and
189- // we can call `get_mut`.
190- c:: LeaveCriticalSection ( ( & mut * self . inner . get ( ) ) . get_mut ( ) ) ;
184+ c:: LeaveCriticalSection ( ( & mut * self . inner . get ( ) ) . as_mut_ptr ( ) ) ;
191185 }
192186
193187 pub unsafe fn destroy ( & self ) {
194- // `init` must have been called, so this is now initialized and
195- // we can call `get_mut`.
196- c:: DeleteCriticalSection ( ( & mut * self . inner . get ( ) ) . get_mut ( ) ) ;
188+ c:: DeleteCriticalSection ( ( & mut * self . inner . get ( ) ) . as_mut_ptr ( ) ) ;
197189 }
198190}
You can’t perform that action at this time.
0 commit comments