|
Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Wrapper around the platform's native lock. More...
#include <mutex.h>
Classes | |
| class | scoped_lock |
| The scoped locking pattern. More... | |
Public Types | |
| enum | state_t { INITIALIZED =0x1234, DESTROYED =0x789A, HELD =0x56CD } |
| typedef pthread_mutex_t * | native_handle_type |
| Return native_handle. More... | |
Public Member Functions | |
| mutex () | |
| Construct unacquired mutex. More... | |
| ~mutex () | |
| void | lock () |
| Acquire lock. More... | |
| bool | try_lock () |
| Try acquiring lock (non-blocking) More... | |
| void | unlock () |
| Release lock. More... | |
| native_handle_type | native_handle () |
Static Public Attributes | |
| static const bool | is_rw_mutex = false |
| static const bool | is_recursive_mutex = false |
| static const bool | is_fair_mutex = false |
Private Member Functions | |
| void __TBB_EXPORTED_METHOD | internal_construct () |
| All checks from mutex constructor using mutex.state were moved here. More... | |
| void __TBB_EXPORTED_METHOD | internal_destroy () |
| All checks from mutex destructor using mutex.state were moved here. More... | |
Private Attributes | |
| pthread_mutex_t | impl |
Friends | |
| class | scoped_lock |
| typedef pthread_mutex_t* tbb::mutex::native_handle_type |
| enum tbb::mutex::state_t |
| Enumerator | |
|---|---|
| INITIALIZED | |
| DESTROYED | |
| HELD | |
|
inline |
Construct unacquired mutex.
Definition at line 38 of file mutex.h.
References tbb::internal::handle_perror(), impl, and internal_construct().
|
inline |
Definition at line 52 of file mutex.h.
References impl, and internal_destroy().
|
private |
All checks from mutex constructor using mutex.state were moved here.
Definition at line 112 of file mutex.cpp.
References _T, tbb::internal::handle_perror(), impl, INITIALIZED, and ITT_SYNC_CREATE.
Referenced by mutex().
|
private |
All checks from mutex destructor using mutex.state were moved here.
Definition at line 124 of file mutex.cpp.
References __TBB_ASSERT, __TBB_ASSERT_EX, DESTROYED, impl, INITIALIZED, and tbb::internal::governor::speculation_enabled().
Referenced by ~mutex().
|
inline |
Acquire lock.
Definition at line 143 of file mutex.h.
References tbb::aligned_space< T, N >::begin(), tbb::internal::handle_perror(), impl, and tbb::mutex::scoped_lock::scoped_lock().
Referenced by tbb::mutex::scoped_lock::acquire().
|
inline |
Definition at line 197 of file mutex.h.
References impl.
|
inline |
Try acquiring lock (non-blocking)
Return true if lock acquired; false otherwise.
Definition at line 160 of file mutex.h.
References tbb::aligned_space< T, N >::begin(), impl, tbb::mutex::scoped_lock::internal_try_acquire(), tbb::mutex::scoped_lock::my_mutex, and s.
Referenced by tbb::mutex::scoped_lock::try_acquire().
|
inline |
Release lock.
Definition at line 176 of file mutex.h.
References tbb::aligned_space< T, N >::begin(), impl, tbb::mutex::scoped_lock::internal_release(), tbb::mutex::scoped_lock::my_mutex, and s.
Referenced by tbb::mutex::scoped_lock::release().
|
friend |
|
private |
Definition at line 209 of file mutex.h.
Referenced by tbb::mutex::scoped_lock::internal_acquire(), internal_construct(), internal_destroy(), tbb::mutex::scoped_lock::internal_release(), tbb::mutex::scoped_lock::internal_try_acquire(), lock(), mutex(), native_handle(), try_lock(), unlock(), and ~mutex().