pub struct RawReentrantMutex<R, G> { /* private fields */ }
Expand description

A raw mutex type that wraps another raw mutex to provide reentrancy.

Although this has the same methods as the RawMutex trait, it does not implement it, and should not be used in the same way, since this mutex can successfully acquire a lock multiple times in the same thread. Only use this when you know you want a raw mutex that can be locked reentrantly; you probably want ReentrantMutex instead.

Implementations§

Initial value for an unlocked mutex.

Acquires this mutex, blocking if it’s held by another thread.

Attempts to acquire this mutex without blocking. Returns true if the lock was successfully acquired and false otherwise.

Unlocks this mutex. The inner mutex may not be unlocked if this mutex was acquired previously in the current thread.

Safety

This method may only be called if the mutex is held by the current thread.

Checks whether the mutex is currently locked.

Checks whether the mutex is currently held by the current thread.

Unlocks this mutex using a fair unlock protocol. The inner mutex may not be unlocked if this mutex was acquired previously in the current thread.

Safety

This method may only be called if the mutex is held by the current thread.

Temporarily yields the mutex to a waiting thread if there is one.

This method is functionally equivalent to calling unlock_fair followed by lock, however it can be much more efficient in the case where there are no waiting threads.

Safety

This method may only be called if the mutex is held by the current thread.

Attempts to acquire this lock until a timeout is reached.

Attempts to acquire this lock until a timeout is reached.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type for metadata in pointers and references to Self.
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
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.
upcast ref
upcast mut ref
upcast boxed dyn
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more