@@ -5,7 +5,7 @@ use crate::cell::UnsafeCell;
5
5
use crate :: fmt;
6
6
use crate :: ops:: { Deref , DerefMut } ;
7
7
use crate :: sync:: { poison, LockResult , TryLockError , TryLockResult } ;
8
- use crate :: sys_common :: mutex as sys;
8
+ use crate :: sys :: locks as sys;
9
9
10
10
/// A mutual exclusion primitive useful for protecting shared data
11
11
///
@@ -163,7 +163,7 @@ use crate::sys_common::mutex as sys;
163
163
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
164
164
#[ cfg_attr( not( test) , rustc_diagnostic_item = "Mutex" ) ]
165
165
pub struct Mutex < T : ?Sized > {
166
- inner : sys:: MovableMutex ,
166
+ inner : sys:: Mutex ,
167
167
poison : poison:: Flag ,
168
168
data : UnsafeCell < T > ,
169
169
}
@@ -217,11 +217,7 @@ impl<T> Mutex<T> {
217
217
#[ rustc_const_stable( feature = "const_locks" , since = "1.63.0" ) ]
218
218
#[ inline]
219
219
pub const fn new ( t : T ) -> Mutex < T > {
220
- Mutex {
221
- inner : sys:: MovableMutex :: new ( ) ,
222
- poison : poison:: Flag :: new ( ) ,
223
- data : UnsafeCell :: new ( t) ,
224
- }
220
+ Mutex { inner : sys:: Mutex :: new ( ) , poison : poison:: Flag :: new ( ) , data : UnsafeCell :: new ( t) }
225
221
}
226
222
}
227
223
@@ -264,7 +260,7 @@ impl<T: ?Sized> Mutex<T> {
264
260
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
265
261
pub fn lock ( & self ) -> LockResult < MutexGuard < ' _ , T > > {
266
262
unsafe {
267
- self . inner . raw_lock ( ) ;
263
+ self . inner . lock ( ) ;
268
264
MutexGuard :: new ( self )
269
265
}
270
266
}
@@ -526,7 +522,7 @@ impl<T: ?Sized> Drop for MutexGuard<'_, T> {
526
522
fn drop ( & mut self ) {
527
523
unsafe {
528
524
self . lock . poison . done ( & self . poison ) ;
529
- self . lock . inner . raw_unlock ( ) ;
525
+ self . lock . inner . unlock ( ) ;
530
526
}
531
527
}
532
528
}
@@ -545,7 +541,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for MutexGuard<'_, T> {
545
541
}
546
542
}
547
543
548
- pub fn guard_lock < ' a , T : ?Sized > ( guard : & MutexGuard < ' a , T > ) -> & ' a sys:: MovableMutex {
544
+ pub fn guard_lock < ' a , T : ?Sized > ( guard : & MutexGuard < ' a , T > ) -> & ' a sys:: Mutex {
549
545
& guard. lock . inner
550
546
}
551
547
0 commit comments