pub struct Mutex<T> {
data: UnsafeCell<T>,
owning: AtomicUsize,
phantom: PhantomData<Rc<()>>,
}
Expand description
Implementation of mtx
structure.
Fields§
§data: UnsafeCell<T>
§owning: AtomicUsize
§phantom: PhantomData<Rc<()>>
Implementations§
Source§impl<T> Mutex<T>
impl<T> Mutex<T>
Sourcepub fn lock(&self) -> MutexGuard<'_, T>
pub fn lock(&self) -> MutexGuard<'_, T>
See _mtx_lock_flags
on the PS4 for a reference.
Sourceunsafe fn unlock(lock: &AtomicUsize)
unsafe fn unlock(lock: &AtomicUsize)
See _mtx_unlock_flags
on the PS4 for a reference.
§Safety
Must be called by the thread that own lock
.
Trait Implementations§
impl<T: Send> Send for Mutex<T>
impl<T: Send> Sync for Mutex<T>
Auto Trait Implementations§
impl<T> !Freeze for Mutex<T>
impl<T> !RefUnwindSafe for Mutex<T>
impl<T> Unpin for Mutex<T>where
T: Unpin,
impl<T> UnwindSafe for Mutex<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more