Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Represents acquisition of a mutex. More...
#include <spin_mutex.h>
Public Member Functions | |
scoped_lock () | |
Construct without acquiring a mutex. More... | |
scoped_lock (spin_mutex &m) | |
Construct and acquire lock on a mutex. More... | |
void | acquire (spin_mutex &m) |
Acquire lock. More... | |
bool | try_acquire (spin_mutex &m) |
Try acquiring lock (non-blocking) More... | |
void | release () |
Release lock. More... | |
~scoped_lock () | |
Destroy lock. If holding a lock, releases the lock first. More... | |
Private Member Functions | |
void __TBB_EXPORTED_METHOD | internal_acquire (spin_mutex &m) |
Like acquire, but with ITT instrumentation. More... | |
bool __TBB_EXPORTED_METHOD | internal_try_acquire (spin_mutex &m) |
Like try_acquire, but with ITT instrumentation. More... | |
void __TBB_EXPORTED_METHOD | internal_release () |
Like release, but with ITT instrumentation. More... | |
![]() | |
no_copy (const no_copy &)=delete | |
no_copy ()=default | |
Private Attributes | |
spin_mutex * | my_mutex |
Points to currently held mutex, or NULL if no lock is held. More... | |
__TBB_Flag | my_unlock_value |
Value to store into spin_mutex::flag to unlock the mutex. More... | |
Friends | |
class | spin_mutex |
Represents acquisition of a mutex.
Definition at line 53 of file spin_mutex.h.
|
inline |
Construct without acquiring a mutex.
Definition at line 77 of file spin_mutex.h.
Referenced by tbb::spin_mutex::lock().
|
inline |
Construct and acquire lock on a mutex.
Definition at line 80 of file spin_mutex.h.
References __TBB_LockByte(), tbb::spin_mutex::flag, internal_acquire(), and tbb::internal::suppress_unused_warning().
|
inline |
Destroy lock. If holding a lock, releases the lock first.
Definition at line 125 of file spin_mutex.h.
References __TBB_EXPORTED_METHOD, __TBB_UnlockByte, tbb::spin_mutex::flag, tbb::spin_mutex::internal_construct(), and internal_release().
|
inline |
Acquire lock.
Definition at line 92 of file spin_mutex.h.
References __TBB_LockByte(), tbb::spin_mutex::flag, and internal_acquire().
Referenced by tbb::internal::generic_scheduler::init_stack_info().
|
private |
Like acquire, but with ITT instrumentation.
Definition at line 24 of file spin_mutex.cpp.
References __TBB_ASSERT, __TBB_LockByte(), tbb::spin_mutex::flag, ITT_NOTIFY, and my_mutex.
Referenced by acquire(), and scoped_lock().
|
private |
Like release, but with ITT instrumentation.
Definition at line 32 of file spin_mutex.cpp.
References __TBB_ASSERT, __TBB_UnlockByte, tbb::spin_mutex::flag, ITT_NOTIFY, my_mutex, and sync_releasing.
Referenced by release(), tbb::spin_mutex::unlock(), and ~scoped_lock().
|
private |
Like try_acquire, but with ITT instrumentation.
Definition at line 40 of file spin_mutex.cpp.
References __TBB_ASSERT, __TBB_TryLockByte(), tbb::spin_mutex::flag, ITT_NOTIFY, and my_mutex.
Referenced by try_acquire().
|
inline |
Release lock.
Definition at line 115 of file spin_mutex.h.
References __TBB_UnlockByte, tbb::spin_mutex::flag, and internal_release().
|
inline |
Try acquiring lock (non-blocking)
Return true if lock acquired; false otherwise.
Definition at line 103 of file spin_mutex.h.
References __TBB_TryLockByte(), tbb::spin_mutex::flag, and internal_try_acquire().
Referenced by tbb::internal::task_stream< num_priority_levels >::pop(), tbb::internal::task_stream< num_priority_levels >::pop_specific(), tbb::internal::task_stream< num_priority_levels >::push(), tbb::internal::task_stream< num_priority_levels >::try_pop(), and tbb::internal::task_stream< num_priority_levels >::try_push().
|
friend |
Definition at line 73 of file spin_mutex.h.
|
private |
Points to currently held mutex, or NULL if no lock is held.
Definition at line 56 of file spin_mutex.h.
Referenced by internal_acquire(), internal_release(), internal_try_acquire(), and tbb::spin_mutex::unlock().
|
private |
Value to store into spin_mutex::flag to unlock the mutex.
This variable is no longer used. Instead, 0 and 1 are used to represent that the lock is free and acquired, respectively. We keep the member variable here to ensure backward compatibility
Definition at line 62 of file spin_mutex.h.