21 #ifndef __TBB__x86_eliding_mutex_impl_H 22 #define __TBB__x86_eliding_mutex_impl_H 24 #ifndef __TBB_spin_mutex_H 25 #error Do not #include this internal file directly; use public TBB headers instead. 28 #if ( __TBB_x86_32 || __TBB_x86_64 ) 31 namespace interface7 {
34 template<
typename Mutex,
bool is_rw>
48 friend class padded_mutex<x86_eliding_mutex, false>;
53 x86_eliding_mutex() : flag(0) {}
57 #if __TBB_USE_X86_ELIDING_MUTEX || __TBB_GCC_VERSION < 40000 69 x86_eliding_mutex* my_mutex;
73 scoped_lock() : my_mutex(NULL) {}
76 scoped_lock( x86_eliding_mutex& m ) : my_mutex(NULL) {
acquire(m); }
79 void acquire( x86_eliding_mutex& m ) {
88 bool try_acquire( x86_eliding_mutex& m ) {
91 bool result = m.try_lock();
100 __TBB_ASSERT( my_mutex,
"release on scoped_lock that is not holding a lock" );
113 #if __TBB_USE_X86_ELIDING_MUTEX || __TBB_GCC_VERSION < 40000 119 static const bool is_rw_mutex =
false;
120 static const bool is_recursive_mutex =
false;
121 static const bool is_fair_mutex =
false;
127 __TBB_LockByteElided(flag);
133 return __TBB_TryLockByteElided(flag);
138 __TBB_UnlockByteElided( flag );
__TBB_atomic __TBB_Flag __TBB_atomic_flag
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Base class for types that should not be copied or assigned.
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 * lock