File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -172,27 +172,19 @@ impl ReentrantMutex {
172
172
}
173
173
174
174
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 ( ) ) ;
178
176
}
179
177
180
178
#[ inline]
181
179
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
185
181
}
186
182
187
183
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 ( ) ) ;
191
185
}
192
186
193
187
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 ( ) ) ;
197
189
}
198
190
}
You can’t perform that action at this time.
0 commit comments