Struct rustpython_common::lock::RawThreadMutex
source · pub struct RawThreadMutex<R: RawMutex, G: GetThreadId> { /* private fields */ }
Expand description
A mutex type that knows when it would deadlock
Implementations§
source§impl<R: RawMutex, G: GetThreadId> RawThreadMutex<R, G>
impl<R: RawMutex, G: GetThreadId> RawThreadMutex<R, G>
pub const INIT: Self = _
sourcepub fn lock(&self) -> bool
pub fn lock(&self) -> bool
Blocks for the mutex to be available, and returns true if the mutex isn’t already locked on the current thread.
Trait Implementations§
impl<R: RawMutex + Send, G: GetThreadId + Send> Send for RawThreadMutex<R, G>
impl<R: RawMutex + Sync, G: GetThreadId + Sync> Sync for RawThreadMutex<R, G>
Auto Trait Implementations§
impl<R, G> RefUnwindSafe for RawThreadMutex<R, G>where G: RefUnwindSafe, R: RefUnwindSafe,
impl<R, G> Unpin for RawThreadMutex<R, G>where G: Unpin, R: Unpin,
impl<R, G> UnwindSafe for RawThreadMutex<R, G>where G: UnwindSafe, R: 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