21 #ifndef __TBB_reader_writer_lock_H 22 #define __TBB_reader_writer_lock_H 24 #include "tbb_thread.h" 25 #include "tbb_allocator.h" 29 namespace interface5 {
74 enum status_t { waiting_nonblocking, waiting, active, invalid };
95 internal_construct(lock);
103 void*
operator new(
size_t s) {
104 return tbb::internal::allocate_via_handler_v3(s);
106 void operator delete(
void* p) {
107 tbb::internal::deallocate_via_handler_v3(p);
122 void __TBB_EXPORTED_METHOD internal_destroy();
132 internal_construct(lock);
140 void*
operator new(
size_t s) {
141 return tbb::internal::allocate_via_handler_v3(s);
143 void operator delete(
void* p) {
144 tbb::internal::deallocate_via_handler_v3(p);
159 void __TBB_EXPORTED_METHOD internal_destroy();
168 void __TBB_EXPORTED_METHOD
lock();
175 bool __TBB_EXPORTED_METHOD
try_lock();
190 void __TBB_EXPORTED_METHOD
unlock();
193 void __TBB_EXPORTED_METHOD internal_construct();
194 void __TBB_EXPORTED_METHOD internal_destroy();
204 bool is_current_writer();
210 void unblock_readers();
void __TBB_EXPORTED_METHOD lock()
Acquires the reader_writer_lock for write.
~scoped_lock_read()
Destructor, releases the read lock.
Definition: reader_writer_lock.h:136
void __TBB_EXPORTED_METHOD unlock()
Releases the reader_writer_lock.
status_t
Status type for nodes associated with lock instances.
Definition: reader_writer_lock.h:74
bool __TBB_EXPORTED_METHOD try_lock_read()
Tries to acquire the reader_writer_lock for read.
reader_writer_lock()
Constructs a new reader_writer_lock.
Definition: reader_writer_lock.h:77
The scoped lock pattern for read locks.
Definition: reader_writer_lock.h:126
The scoped lock pattern for write locks.
Definition: reader_writer_lock.h:89
void __TBB_EXPORTED_METHOD lock_read()
Acquires the reader_writer_lock for read.
~scoped_lock()
Destructor, releases the write lock.
Definition: reader_writer_lock.h:99
~reader_writer_lock()
Destructs a reader_writer_lock object.
Definition: reader_writer_lock.h:82
scoped_lock(reader_writer_lock &lock)
Construct with blocking attempt to acquire write lock on the passed-in lock.
Definition: reader_writer_lock.h:94
bool __TBB_EXPORTED_METHOD try_lock()
Tries to acquire the reader_writer_lock for write.
Definition: tbb_thread.h:233
scoped_lock_read(reader_writer_lock &lock)
Construct with blocking attempt to acquire read lock on the passed-in lock.
Definition: reader_writer_lock.h:131
The namespace tbb contains all components of the library.
Definition: parallel_for.h:44
Writer-preference reader-writer lock with local-only spinning on readers.
Definition: reader_writer_lock.h:34
Wrapper around the platform's native reader-writer lock.
Definition: mutex.h:40