17 #ifndef __TBB_reader_writer_lock_H 18 #define __TBB_reader_writer_lock_H 25 namespace interface5 {
99 void*
operator new(
size_t s) {
102 void operator delete(
void*
p) {
136 void*
operator new(
size_t s) {
139 void operator delete(
void*
p) {
void __TBB_EXPORTED_METHOD internal_construct()
scoped_lock(reader_writer_lock &lock)
Construct with blocking attempt to acquire write lock on the passed-in lock.
scoped_lock_read(reader_writer_lock &lock)
Construct with blocking attempt to acquire read lock on the passed-in lock.
atomic< scoped_lock_read * > reader_head
The list of pending readers.
void __TBB_EXPORTED_METHOD internal_destroy()
#define __TBB_EXPORTED_METHOD
scoped_lock_read()
Construct scoped_lock_read that is not holding lock.
scoped_lock()
Construct scoped_lock that is not holding lock.
void const char const char int ITT_FORMAT __itt_group_sync s
void __TBB_EXPORTED_FUNC deallocate_via_handler_v3(void *p)
Deallocates memory using FreeHandler.
~scoped_lock_read()
Destructor, releases the read lock.
reader_writer_lock * mutex
The pointer to the mutex to lock.
void *__TBB_EXPORTED_FUNC allocate_via_handler_v3(size_t n)
Allocates memory using MallocHandler.
void __TBB_EXPORTED_METHOD internal_destroy()
Base class for types that should not be copied or assigned.
The scoped lock pattern for write locks.
tbb_thread::id my_current_writer
Writer that owns the mutex; tbb_thread::id() otherwise.
atomic< scoped_lock * > writer_tail
The last node in the list of pending writers.
void end_read()
Relinquishes read lock by decrementing counter; last reader wakes pending writer.
bool __TBB_EXPORTED_METHOD try_lock_read()
Tries to acquire the reader_writer_lock for read.
bool __TBB_EXPORTED_METHOD try_lock()
Tries to acquire the reader_writer_lock for write.
void __TBB_EXPORTED_METHOD lock_read()
Acquires the reader_writer_lock for read.
status_t
Status type for nodes associated with lock instances.
reader_writer_lock()
Constructs a new reader_writer_lock.
void start_read(scoped_lock_read *)
Attempts to acquire read lock.
void __TBB_EXPORTED_METHOD lock()
Acquires the reader_writer_lock for write.
scoped_lock_read * next
The next queued competitor for the mutex.
void unblock_readers()
Unblocks pending readers.
reader_writer_lock * mutex
The pointer to the mutex to lock.
void __TBB_EXPORTED_METHOD unlock()
Releases the reader_writer_lock.
bool is_current_writer()
Checks if current thread holds write lock.
void set_next_writer(scoped_lock *w)
Sets writer_head to w and attempts to unblock.
scoped_lock * next
The next queued competitor for the mutex.
void __TBB_EXPORTED_METHOD internal_construct(reader_writer_lock &)
atomic< uintptr_t > rdr_count_and_flags
Status of mutex.
Writer-preference reader-writer lock with local-only spinning on readers.
~scoped_lock()
Destructor, releases the write lock.
atomic< status_t > status
Status flag of the thread associated with this node.
atomic< status_t > status
Status flag of the thread associated with this node.
~reader_writer_lock()
Destructs a reader_writer_lock object.
atomic< scoped_lock * > writer_head
The list of pending writers.
void __TBB_EXPORTED_METHOD internal_construct(reader_writer_lock &)
bool start_write(scoped_lock *)
Attempts to acquire write lock.
The scoped lock pattern for read locks.
void const char const char int ITT_FORMAT __itt_group_sync p
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id id
void end_write(scoped_lock *)
Relinquishes write lock to next waiting writer or group of readers.
void __TBB_EXPORTED_METHOD internal_destroy()