21 #ifndef __TBB_queuing_rw_mutex_H 22 #define __TBB_queuing_rw_mutex_H 24 #include "tbb_config.h" 26 #if !TBB_USE_EXCEPTIONS && _MSC_VER 28 #pragma warning (push) 29 #pragma warning (disable: 4530) 34 #if !TBB_USE_EXCEPTIONS && _MSC_VER 39 #include "tbb_profiling.h" 52 #if TBB_USE_THREADING_TOOLS 60 __TBB_ASSERT( !q_tail,
"destruction of an acquired mutex");
73 internal::poison_pointer(my_next);
74 internal::poison_pointer(my_prev);
115 scoped_lock *__TBB_atomic my_prev, *__TBB_atomic my_next;
117 typedef unsigned char state_t;
124 unsigned char __TBB_atomic my_going;
127 unsigned char my_internal_lock;
130 void acquire_internal_lock();
134 bool try_acquire_internal_lock();
137 void release_internal_lock();
140 void wait_for_release_of_internal_lock();
143 void unblock_or_wait_on_internal_lock( uintptr_t );
146 void __TBB_EXPORTED_METHOD internal_construct();
149 static const bool is_rw_mutex =
true;
150 static const bool is_recursive_mutex =
false;
151 static const bool is_fair_mutex =
true;
bool downgrade_to_reader()
Downgrade writer to become a reader.
~scoped_lock()
Release lock (if lock is held).
Definition: queuing_rw_mutex.h:90
The scoped locking pattern.
Definition: queuing_rw_mutex.h:67
scoped_lock(queuing_rw_mutex &m, bool write=true)
Acquire lock on given mutex.
Definition: queuing_rw_mutex.h:84
bool upgrade_to_writer()
Upgrade reader to become a writer.
queuing_rw_mutex()
Construct unacquired mutex.
Definition: queuing_rw_mutex.h:50
void release()
Release lock.
The namespace tbb contains all components of the library.
Definition: parallel_for.h:44
bool try_acquire(queuing_rw_mutex &m, bool write=true)
Acquire lock on given mutex if free (i.e. non-blocking)
void acquire(queuing_rw_mutex &m, bool write=true)
Acquire lock on given mutex.
~queuing_rw_mutex()
Destructor asserts if the mutex is acquired, i.e. q_tail is non-NULL.
Definition: queuing_rw_mutex.h:58
Queuing reader-writer mutex with local-only spinning.
Definition: queuing_rw_mutex.h:47
scoped_lock()
Construct lock that has not acquired a mutex.
Definition: queuing_rw_mutex.h:81