Struct cooptex::CoopMutex[][src]

pub struct CoopMutex<T> { /* fields omitted */ }
Expand description

A deadlock-free version of Mutex.

This is only deadlock-free if:

  1. All Mutexes that may deadlock are CoopMutexes
  2. When Retry is returned, the requesting thread drops all other MutexGuards it is holding. Easily accomplished with retry_loop.

Implementations

Create a new CoopMutex holding the provided item.

Acquire a mutex or return Err(Retry), indicating that the current thread should drop all its currently held locks and try to acquire them again. Use retry_loop to automatically use the correct behavior.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.