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.
|
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(), my_mutex, my_unlock_value, 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_UnlockByte, tbb::spin_mutex::flag, internal_release(), and my_mutex.
|
inline |
Acquire lock.
Definition at line 92 of file spin_mutex.h.
References __TBB_LockByte(), tbb::spin_mutex::flag, internal_acquire(), and my_mutex.
|
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, ITT_NOTIFY, and sync_releasing.
Referenced by release(), 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, and ITT_NOTIFY.
Referenced by try_acquire().
|
inline |
Release lock.
Definition at line 115 of file spin_mutex.h.
References __TBB_UnlockByte, tbb::spin_mutex::flag, internal_release(), and my_mutex.
|
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, internal_try_acquire(), and my_mutex.
|
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 acquire(), internal_acquire(), release(), scoped_lock(), try_acquire(), and ~scoped_lock().
|
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.
Referenced by scoped_lock().