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
__TBB_atomic __TBB_Flag __TBB_atomic_flag
__TBB_Flag __TBB_LockByte(__TBB_atomic_flag &flag)
bool __TBB_TryLockByte(__TBB_atomic_flag &flag)
#define __TBB_DEFINE_PROFILING_SET_NAME(sync_object_type)
#define __TBB_EXPORTED_METHOD
void const char const char int ITT_FORMAT __itt_group_sync s
interface7::internal::padded_mutex< spin_mutex, false > speculative_spin_mutex
A cross-platform spin mutex with speculative lock acquisition.
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
A lock that occupies a single byte.
bool try_lock()
Try acquiring lock (non-blocking)
static const bool is_recursive_mutex
void __TBB_EXPORTED_METHOD internal_construct()
Internal constructor with ITT instrumentation.
spin_mutex()
Construct unacquired lock.
static const bool is_rw_mutex
static const bool is_fair_mutex
void unlock()
Release lock.
__TBB_atomic_flag flag
0 if lock is released, 1 if lock is acquired.
Represents acquisition of a mutex.
scoped_lock()
Construct without acquiring a mutex.
__TBB_Flag my_unlock_value
Value to store into spin_mutex::flag to unlock the mutex.
spin_mutex * my_mutex
Points to currently held mutex, or NULL if no lock is held.
void __TBB_EXPORTED_METHOD internal_acquire(spin_mutex &m)
Like acquire, but with ITT instrumentation.
void __TBB_EXPORTED_METHOD internal_release()
Like release, but with ITT instrumentation.
scoped_lock(spin_mutex &m)
Construct and acquire lock on a mutex.
bool try_acquire(spin_mutex &m)
Try acquiring lock (non-blocking)
void acquire(spin_mutex &m)
Acquire lock.
void release()
Release lock.
~scoped_lock()
Destroy lock. If holding a lock, releases the lock first.
bool __TBB_EXPORTED_METHOD internal_try_acquire(spin_mutex &m)
Like try_acquire, but with ITT instrumentation.
Base class for types that should not be copied or assigned.