Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Go to the documentation of this file.
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
scoped_lock(spin_mutex &m)
Construct and acquire lock on a mutex.
void __TBB_EXPORTED_METHOD internal_acquire(spin_mutex &m)
Like acquire, but with ITT instrumentation.
__TBB_Flag my_unlock_value
Value to store into spin_mutex::flag to unlock the mutex.
bool try_lock()
Try acquiring lock (non-blocking)
static const bool is_rw_mutex
Base class for types that should not be copied or assigned.
void unlock()
Release lock.
__TBB_Flag __TBB_LockByte(__TBB_atomic_flag &flag)
scoped_lock()
Construct without acquiring a mutex.
spin_mutex()
Construct unacquired lock.
Represents acquisition of a mutex.
void __TBB_EXPORTED_METHOD internal_release()
Like release, but with ITT instrumentation.
static const bool is_fair_mutex
void acquire(spin_mutex &m)
Acquire lock.
bool __TBB_TryLockByte(__TBB_atomic_flag &flag)
bool try_acquire(spin_mutex &m)
Try acquiring lock (non-blocking)
void __TBB_EXPORTED_METHOD internal_construct()
Internal constructor with ITT instrumentation.
static const bool is_recursive_mutex
void const char const char int ITT_FORMAT __itt_group_sync s
bool __TBB_EXPORTED_METHOD internal_try_acquire(spin_mutex &m)
Like try_acquire, but with ITT instrumentation.
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
__TBB_atomic __TBB_Flag __TBB_atomic_flag
~scoped_lock()
Destroy lock. If holding a lock, releases the lock first.
void release()
Release lock.
interface7::internal::padded_mutex< spin_mutex, false > speculative_spin_mutex
A cross-platform spin mutex with speculative lock acquisition.
A lock that occupies a single byte.
#define __TBB_DEFINE_PROFILING_SET_NAME(sync_object_type)
spin_mutex * my_mutex
Points to currently held mutex, or NULL if no lock is held.
#define __TBB_EXPORTED_METHOD
__TBB_atomic_flag flag
0 if lock is released, 1 if lock is acquired.
Copyright © 2005-2020 Intel Corporation. All Rights Reserved.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.