17 #ifndef __TBB_spin_mutex_H 18 #define __TBB_spin_mutex_H 20 #define __TBB_spin_mutex_H_include_area 47 #if TBB_USE_THREADING_TOOLS 82 #if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT 93 #if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT 104 #if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT 116 #if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT 127 #if TBB_USE_THREADING_TOOLS||TBB_USE_ASSERT 148 #if TBB_USE_THREADING_TOOLS 149 aligned_space<scoped_lock> tmp;
159 #if TBB_USE_THREADING_TOOLS 160 aligned_space<scoped_lock> tmp;
161 return (
new(tmp.begin())
scoped_lock)->internal_try_acquire(*
this);
169 #if TBB_USE_THREADING_TOOLS 170 aligned_space<scoped_lock> tmp;
173 s.internal_release();
186 #if ( __TBB_x86_32 || __TBB_x86_64 ) 202 #if ( __TBB_x86_32 || __TBB_x86_64 ) 203 typedef interface7::internal::padded_mutex<interface7::internal::x86_eliding_mutex,false>
speculative_spin_mutex;
212 #undef __TBB_spin_mutex_H_include_area void acquire(spin_mutex &m)
Acquire lock.
static const bool is_rw_mutex
void unlock()
Release lock.
static const bool is_recursive_mutex
void __TBB_EXPORTED_METHOD internal_release()
Like release, but with ITT instrumentation.
scoped_lock(spin_mutex &m)
Construct and acquire lock on a mutex.
#define __TBB_DEFINE_PROFILING_SET_NAME(sync_object_type)
__TBB_atomic __TBB_Flag __TBB_atomic_flag
bool try_acquire(spin_mutex &m)
Try acquiring lock (non-blocking)
A lock that occupies a single byte.
void __TBB_EXPORTED_METHOD internal_acquire(spin_mutex &m)
Like acquire, but with ITT instrumentation.
bool __TBB_TryLockByte(__TBB_atomic_flag &flag)
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
__TBB_Flag __TBB_LockByte(__TBB_atomic_flag &flag)
static const bool is_fair_mutex
void release()
Release lock.
scoped_lock()
Construct without acquiring a mutex.
bool __TBB_EXPORTED_METHOD internal_try_acquire(spin_mutex &m)
Like try_acquire, but with ITT instrumentation.
interface7::internal::padded_mutex< spin_mutex, false > speculative_spin_mutex
A cross-platform spin mutex with speculative lock acquisition.
Represents acquisition of a mutex.
Base class for types that should not be copied or assigned.
void __TBB_EXPORTED_METHOD internal_construct()
Internal constructor with ITT instrumentation.
__TBB_atomic_flag flag
0 if lock is released, 1 if lock is acquired.
bool try_lock()
Try acquiring lock (non-blocking)
spin_mutex()
Construct unacquired lock.
void const char const char int ITT_FORMAT __itt_group_sync s
#define __TBB_EXPORTED_METHOD
spin_mutex * my_mutex
Points to currently held mutex, or NULL if no lock is held.
__TBB_Flag my_unlock_value
Value to store into spin_mutex::flag to unlock the mutex.
~scoped_lock()
Destroy lock. If holding a lock, releases the lock first.