|
libosmscout 0.1
|
This implements a pure C++ Latch providing lock-S (shared) and lock-X (exclusive). More...
#include <ReadWriteLock.h>
Public Member Functions | |
| Latch () | |
| Latch (bool _px) | |
| Latch (const Latch &)=delete | |
| Latch (Latch &&)=delete | |
| void | lock () |
| void | lock_shared () |
| Latch & | operator= (const Latch &)=delete |
| Latch & | operator= (Latch &&)=delete |
| bool | try_lock_shared () |
| void | unlock () |
| void | unlock_shared () |
| ~Latch () | |
This implements a pure C++ Latch providing lock-S (shared) and lock-X (exclusive).
The concept used here allows X requests to be prioritized faster and more smoothly than standard implementations. It uses a no-lock strategy whenever possible and reverts to lock and wait in race condition.
| osmscout::Latch::Latch | ( | ) |
|
inlineexplicit |
|
delete |
|
delete |
| osmscout::Latch::~Latch | ( | ) |
References n.
| void osmscout::Latch::lock | ( | ) |
References n, osmscout::X_STEP_0, osmscout::X_STEP_1, osmscout::X_STEP_2, and osmscout::X_STEP_3.
Referenced by osmscout::WriteLock::lock(), and osmscout::WriteLock::WriteLock().
| void osmscout::Latch::lock_shared | ( | ) |
References n, osmscout::X_STEP_0, osmscout::X_STEP_1, and osmscout::X_STEP_2.
Referenced by osmscout::ReadLock::lock(), and osmscout::ReadLock::ReadLock().
| bool osmscout::Latch::try_lock_shared | ( | ) |
References n, and osmscout::X_STEP_0.
Referenced by osmscout::ReadLock::try_lock().
| void osmscout::Latch::unlock | ( | ) |
References osmscout::X_STEP_0, and osmscout::X_STEP_2.
Referenced by osmscout::WriteLock::unlock(), and osmscout::WriteLock::~WriteLock().
| void osmscout::Latch::unlock_shared | ( | ) |
References n, osmscout::X_STEP_1, and osmscout::X_STEP_3.
Referenced by osmscout::ReadLock::unlock(), and osmscout::ReadLock::~ReadLock().