[−][src]Trait os_sync::mutex::Mutex
Describes Mutex interface
Required methods
fn new() -> Option<Self>
Creates new instance
Returns if Semaphore
is successfully created.
fn lock(&self) -> MutexGuard<Self>
Acquires lock, returning guard that unlocks self on drop.
If lock is already acquired, it blocks until mutex is unlocked
fn try_lock(&self) -> Option<MutexGuard<Self>>
Attempts to acquire lock, returning guard that unlocks self on drop.
If lock is already acquired, it returns None
fn unlock(&self, token: GuardToken)
Tells how to perform unlock.
Method implementation should be safe, but is allowed to mis-behave when invoked without
prior lock