Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
The scoped lock pattern for write locks. More...
#include <reader_writer_lock.h>
Public Member Functions | |
scoped_lock (reader_writer_lock &lock) | |
Construct with blocking attempt to acquire write lock on the passed-in lock. More... | |
~scoped_lock () | |
Destructor, releases the write lock. More... | |
void * | operator new (size_t s) |
void | operator delete (void *p) |
Private Member Functions | |
scoped_lock () | |
Construct scoped_lock that is not holding lock. More... | |
void __TBB_EXPORTED_METHOD | internal_construct (reader_writer_lock &) |
void __TBB_EXPORTED_METHOD | internal_destroy () |
![]() | |
no_copy () | |
Allow default construction. More... | |
Private Attributes | |
reader_writer_lock * | mutex |
The pointer to the mutex to lock. More... | |
scoped_lock * | next |
The next queued competitor for the mutex. More... | |
atomic< status_t > | status |
Status flag of the thread associated with this node. More... | |
Friends | |
class | reader_writer_lock |
The scoped lock pattern for write locks.
Scoped locks help avoid the common problem of forgetting to release the lock. This type also serves as the node for queuing locks.
Definition at line 89 of file reader_writer_lock.h.
|
inline |
Construct with blocking attempt to acquire write lock on the passed-in lock.
Definition at line 94 of file reader_writer_lock.h.
References internal_construct(), and tbb::interface5::reader_writer_lock::lock().
|
inline |
Destructor, releases the write lock.
Definition at line 99 of file reader_writer_lock.h.
References internal_destroy().
|
inlineprivate |
Construct scoped_lock that is not holding lock.
Definition at line 310 of file reader_writer_lock.cpp.
References status, and tbb::interface5::reader_writer_lock::waiting.
|
private |
Definition at line 297 of file reader_writer_lock.cpp.
References tbb::internal::eid_improper_lock, tbb::interface5::reader_writer_lock::lock(), next, status, tbb::internal::throw_exception(), void, and tbb::interface5::reader_writer_lock::waiting.
Referenced by scoped_lock().
|
private |
Definition at line 332 of file reader_writer_lock.cpp.
References __TBB_ASSERT, and tbb::interface5::reader_writer_lock::invalid.
Referenced by ~scoped_lock().
Definition at line 106 of file reader_writer_lock.h.
References tbb::internal::deallocate_via_handler_v3(), and p.
|
inline |
Definition at line 103 of file reader_writer_lock.h.
References tbb::internal::allocate_via_handler_v3(), and s.
|
friend |
Definition at line 91 of file reader_writer_lock.h.
|
private |
The pointer to the mutex to lock.
Definition at line 112 of file reader_writer_lock.h.
|
private |
The next queued competitor for the mutex.
Definition at line 114 of file reader_writer_lock.h.
Referenced by tbb::interface5::reader_writer_lock::end_write(), internal_construct(), and tbb::interface5::reader_writer_lock::start_write().
Status flag of the thread associated with this node.
Definition at line 116 of file reader_writer_lock.h.
Referenced by internal_construct(), scoped_lock(), tbb::interface5::reader_writer_lock::set_next_writer(), tbb::interface5::reader_writer_lock::start_write(), and tbb::interface5::reader_writer_lock::try_lock().