Struct cpuprofiler::PROFILER
[−]
pub struct PROFILER { // some fields omitted }
Methods from __Deref<Target=Mutex<Profiler>>
fn lock(&self) -> Result<MutexGuard<T>, PoisonError<MutexGuard<T>>>
1.0.0
Acquires a mutex, blocking the current thread until it is able to do so.
This function will block the local thread until it is available to acquire the mutex. Upon returning, the thread is the only thread with the mutex held. An RAII guard is returned to allow scoped unlock of the lock. When the guard goes out of scope, the mutex will be unlocked.
The exact behavior on locking a mutex in the thread which already holds the lock is left unspecified. However, this function will not return on the second call (it might panic or deadlock, for example).
Errors
If another user of this mutex panicked while holding the mutex, then this call will return an error once the mutex is acquired.
Panics
This function might panic when called if the lock is already held by the current thread.
fn try_lock(&self) -> Result<MutexGuard<T>, TryLockError<MutexGuard<T>>>
1.0.0
Attempts to acquire this lock.
If the lock could not be acquired at this time, then Err
is returned.
Otherwise, an RAII guard is returned. The lock will be unlocked when the
guard is dropped.
This function does not block.
Errors
If another user of this mutex panicked while holding the mutex, then this call will return failure if the mutex would otherwise be acquired.
fn is_poisoned(&self) -> bool
1.2.0
Determines whether the lock is poisoned.
If another thread is active, the lock can still become poisoned at any
time. You should not trust a false
value for program correctness
without additional synchronization.
fn into_inner(self) -> Result<T, PoisonError<T>>
1.6.0
Consumes this mutex, returning the underlying data.
Errors
If another user of this mutex panicked while holding the mutex, then this call will return an error instead.
fn get_mut(&mut self) -> Result<&mut T, PoisonError<&mut T>>
1.6.0
Returns a mutable reference to the underlying data.
Since this call borrows the Mutex
mutably, no actual locking needs to
take place---the mutable borrow statically guarantees no locks exist.
Errors
If another user of this mutex panicked while holding the mutex, then this call will return an error instead.