SpinLock.
More...
#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/concurrency/arccore/concurrency/SpinLock.h>
◆ eMode
Spinlock mode. The default is 'Auto'.
| Enumerator |
|---|
| Auto | Automatic choice.
If Concurrency::getThreadImplementation()->isMultiThread() is true, then the mode is SpinAndMutex. Otherwise, the mode is None.
|
| FullSpin | Always uses a spinlock.
This type is faster if there is very little contention, but performance is very poor otherwise.
|
| SpinAndMutex | SpinLock then mutex.
Performs a spinlock then yields (std::this_thread::yield()) if it takes too long. This mode is only available if C++20 is used. Otherwise, it is equivalent to FullSpin.
|
Definition at line 80 of file arccore/src/concurrency/arccore/concurrency/SpinLock.h.
◆ SpinLock() [1/2]
| Arcane::SpinLock::SpinLock |
( |
| ) |
|
◆ SpinLock() [2/2]
| Arcane::SpinLock::SpinLock |
( |
eMode | mode | ) |
|
◆ ~SpinLock()
| Arcane::SpinLock::~SpinLock |
( |
| ) |
|
◆ _doLock()
| void Arcane::SpinLock::_doLock |
( |
| ) |
|
|
inlineprivate |
◆ _doLockReal()
| void Arcane::SpinLock::_doLockReal |
( |
| ) |
|
|
private |
◆ _doUnlock()
| void Arcane::SpinLock::_doUnlock |
( |
| ) |
|
|
inlineprivate |
◆ _doUnlockReal()
| void Arcane::SpinLock::_doUnlockReal |
( |
| ) |
|
|
private |
◆ ManualLock
◆ ScopedLock
◆ m_mode
◆ m_spin_lock
| std::atomic_flag Arcane::SpinLock::m_spin_lock = ATOMIC_FLAG_INIT |
|
private |
The documentation for this class was generated from the following files: