#include <spin_mutex.h>
Public Member Functions | |
spin_mutex () | |
Construct unacquired lock. | |
void __TBB_EXPORTED_METHOD | internal_construct () |
void | lock () |
Acquire lock. | |
bool | try_lock () |
Try acquiring lock (non-blocking). | |
void | unlock () |
Release lock. | |
Static Public Attributes | |
static const bool | is_rw_mutex = false |
static const bool | is_recursive_mutex = false |
static const bool | is_fair_mutex = false |
Friends | |
class | scoped_lock |
Classes | |
class | scoped_lock |
Represents acquisition of a mutex. More... |
A spin_mutex is a spin mutex that fits in a single byte. It should be used only for locking short critical sections (typically less than 20 instructions) when fairness is not an issue. If zero-initialized, the mutex is considered unheld.
tbb::spin_mutex::spin_mutex | ( | ) | [inline] |
Construct unacquired lock.
Equivalent to zero-initialization of *this.
bool tbb::spin_mutex::try_lock | ( | ) | [inline] |
Try acquiring lock (non-blocking).
Return true if lock acquired; false otherwise.