Public Member Functions | |
void | lock () |
void | spinlock () |
bool | trylock () |
void | unlock () |
Public Member Functions inherited from DD::Image::Lock | |
Lock () | |
pthread_mutex_t & | get_mutex () |
void | lock () |
void | spinlock () |
void | unlock () |
bool | trylock () |
void | spinsignal () |
void | spinwait () |
virtual | ~Lock () |
Additional Inherited Members | |
Protected Member Functions inherited from DD::Image::Lock | |
Lock (const pthread_mutexattr_t *a) | |
This is the same as a Lock except a thread can call lock() several times (all subsequent calls return immediatly) and must call unlock() the same number of times before another thread calling lock() will return.
|
inline |
When this returns, the calling thread will "own" the lock.
If no thread owns the lock this will return immediately.
If another thread owns the lock this will block (not return) until that other thread calls unlock().
If this thread already owns the lock, this returns immediately, but an internal counter is incremented so that unlock() must be called the same number of times.
Referenced by DD::Image::OpTreeHandler::lockTrees().
|
inline |
Release the lock. If lock() was called more than once, this decrementes the lock counter. Once this goes to zero the lock is really unlocked and another thread's call to lock() can return.
Referenced by DD::Image::OpTreeHandler::unlockTrees().
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |