Struct shared_mutex::RawSharedMutex [] [src]

pub struct RawSharedMutex { /* fields omitted */ }

A raw lock providing both shared read locks and exclusive write locks.

Used as a raw building block for other synchronization primitives. Most users should just use SharedMutex<T>, which takes care of tieing the lock to some data.

Methods

impl RawSharedMutex
[src]

Create a new RawSharedMutex

Checks if this mutex and the other are the same mutex.

If is returns true, the two references point to the same mutex, and they may be used interchangeably.

Acquire a shared read lock.

Blocks until a read lock can be acquired. The lock can be released by calling unlock_read.

Attempt to acquire a shared read lock without blocking.

Returns true if we succeeded and false if acquiring a read lock would require blocking.

Acquire an exclusive write lock.

Blocks until the write lock can be acquired. The lock can be released by calling unlock_write.

Attempt to acquire an exclusive write lock without blocking.

Returns true if we succeeded and false if acquiring the write lock would require blocking.

Unlock a previously acquired read lock.

Behavior is unspecified (but not undefined) if unlock_read is called without a previous accompanying read.

Unlock a previously acquired write lock.

Behavior is unspecified (but not undefined) if unlock_write is called without a previous accompanying write.

Wait on the given condition variable, resuming with a write lock.

Behavior is unspecified if there was no previous accompanying read.

Wait on the given condition variable, resuming with another read lock.

Behavior is unspecified if there was no previous accompanying read.

Wait on the given condition variable, resuming with a read lock.

Behavior is unspecified if there was no previous accompanying write.

Wait on the given condition variable, resuming with another write lock.

Behavior is unspecified if there was no previous accompanying write.