@@ -5,7 +5,7 @@ use crate::cell::UnsafeCell;
55use crate :: fmt;
66use crate :: ops:: { Deref , DerefMut } ;
77use crate :: sync:: { poison, LockResult , TryLockError , TryLockResult } ;
8- use crate :: sys_common :: mutex as sys;
8+ use crate :: sys :: locks as sys;
99
1010/// A mutual exclusion primitive useful for protecting shared data
1111///
@@ -163,7 +163,7 @@ use crate::sys_common::mutex as sys;
163163#[ stable( feature = "rust1" , since = "1.0.0" ) ]
164164#[ cfg_attr( not( test) , rustc_diagnostic_item = "Mutex" ) ]
165165pub struct Mutex < T : ?Sized > {
166- inner : sys:: MovableMutex ,
166+ inner : sys:: Mutex ,
167167 poison : poison:: Flag ,
168168 data : UnsafeCell < T > ,
169169}
@@ -217,11 +217,7 @@ impl<T> Mutex<T> {
217217 #[ rustc_const_stable( feature = "const_locks" , since = "1.63.0" ) ]
218218 #[ inline]
219219 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) }
225221 }
226222}
227223
@@ -264,7 +260,7 @@ impl<T: ?Sized> Mutex<T> {
264260 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
265261 pub fn lock ( & self ) -> LockResult < MutexGuard < ' _ , T > > {
266262 unsafe {
267- self . inner . raw_lock ( ) ;
263+ self . inner . lock ( ) ;
268264 MutexGuard :: new ( self )
269265 }
270266 }
@@ -526,7 +522,7 @@ impl<T: ?Sized> Drop for MutexGuard<'_, T> {
526522 fn drop ( & mut self ) {
527523 unsafe {
528524 self . lock . poison . done ( & self . poison ) ;
529- self . lock . inner . raw_unlock ( ) ;
525+ self . lock . inner . unlock ( ) ;
530526 }
531527 }
532528}
@@ -545,7 +541,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for MutexGuard<'_, T> {
545541 }
546542}
547543
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 {
549545 & guard. lock . inner
550546}
551547
0 commit comments