Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
The scoped locking pattern. More...
#include <recursive_mutex.h>
Public Member Functions | |
scoped_lock () | |
Construct lock that has not acquired a recursive_mutex. More... | |
scoped_lock (recursive_mutex &mutex) | |
Acquire lock on given mutex. More... | |
~scoped_lock () | |
Release lock (if lock is held). More... | |
void | acquire (recursive_mutex &mutex) |
Acquire lock on given mutex. More... | |
bool | try_acquire (recursive_mutex &mutex) |
Try acquire lock on given recursive_mutex. More... | |
void | release () |
Release lock. More... | |
Private Member Functions | |
void __TBB_EXPORTED_METHOD | internal_acquire (recursive_mutex &m) |
All checks from acquire using mutex.state were moved here. More... | |
bool __TBB_EXPORTED_METHOD | internal_try_acquire (recursive_mutex &m) |
All checks from try_acquire using mutex.state were moved here. More... | |
void __TBB_EXPORTED_METHOD | internal_release () |
All checks from release using mutex.state were moved here. More... | |
![]() | |
no_copy () | |
Allow default construction. More... | |
Private Attributes | |
recursive_mutex * | my_mutex |
The pointer to the current recursive_mutex to work. More... | |
Friends | |
class | recursive_mutex |
The scoped locking pattern.
It helps to avoid the common problem of forgetting to release lock. It also nicely provides the "node" for queuing locks.
Definition at line 83 of file recursive_mutex.h.
|
inline |
Construct lock that has not acquired a recursive_mutex.
Definition at line 86 of file recursive_mutex.h.
|
inline |
Acquire lock on given mutex.
Definition at line 89 of file recursive_mutex.h.
References acquire(), and my_mutex.
|
inline |
Release lock (if lock is held).
Definition at line 97 of file recursive_mutex.h.
References my_mutex, and release().
|
inline |
Acquire lock on given mutex.
Definition at line 103 of file recursive_mutex.h.
References internal_acquire(), tbb::mutex::lock(), and my_mutex.
Referenced by scoped_lock().
|
private |
All checks from acquire using mutex.state were moved here.
Definition at line 26 of file recursive_mutex.cpp.
References __TBB_ASSERT, tbb::internal::handle_perror(), tbb::recursive_mutex::impl, and my_mutex.
Referenced by acquire().
|
private |
All checks from release using mutex.state were moved here.
Definition at line 52 of file recursive_mutex.cpp.
References __TBB_ASSERT, and __TBB_ASSERT_EX.
Referenced by release().
|
private |
All checks from try_acquire using mutex.state were moved here.
Definition at line 73 of file recursive_mutex.cpp.
References __TBB_ASSERT, and tbb::recursive_mutex::impl.
Referenced by try_acquire().
|
inline |
Release lock.
Definition at line 125 of file recursive_mutex.h.
References internal_release(), my_mutex, and tbb::recursive_mutex::unlock().
Referenced by ~scoped_lock().
|
inline |
Try acquire lock on given recursive_mutex.
Definition at line 113 of file recursive_mutex.h.
References internal_try_acquire(), my_mutex, and tbb::mutex::try_lock().
|
friend |
Definition at line 147 of file recursive_mutex.h.
|
private |
The pointer to the current recursive_mutex to work.
Definition at line 136 of file recursive_mutex.h.
Referenced by acquire(), internal_acquire(), release(), scoped_lock(), try_acquire(), and ~scoped_lock().