![]() |
OpendTect-6_4
6.4
|
Is an alternative to Mutex. It is a lock which causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking if the lock is available. Because they avoid overhead from operating system process re-scheduling or context switching, spinlocks are efficient if threads are only likely to be blocked for a short period. More...
Public Member Functions | |
| SpinLock (bool recursive=false) | |
| SpinLock (const SpinLock &) | |
| ~SpinLock () | |
| SpinLock & | operator= (const SpinLock &b) |
| void | lock () |
| void | unLock () |
| bool | tryLock () |
| int | count () const |
Protected Attributes | |
| AtomicPointer< const void > | lockingthread_ |
| int | count_ |
| bool | recursive_ |
Is an alternative to Mutex. It is a lock which causes a thread trying to acquire it to simply wait in a loop ("spin") while repeatedly checking if the lock is available. Because they avoid overhead from operating system process re-scheduling or context switching, spinlocks are efficient if threads are only likely to be blocked for a short period.
| Threads::SpinLock::SpinLock | ( | bool | recursive = false | ) |
| Threads::SpinLock::SpinLock | ( | const SpinLock & | ) |
| Threads::SpinLock::~SpinLock | ( | ) |
|
inline |
Only for debugging.
| void Threads::SpinLock::lock | ( | ) |
| bool Threads::SpinLock::tryLock | ( | ) |
| void Threads::SpinLock::unLock | ( | ) |
|
protected |
|
protected |
0 if unlocked, otherwise set to locking thread
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019