#include <thread.h>
Public Member Functions | |
ReadLock (ThreadLock &_tl) | |
Wait for read access. | |
~ReadLock () | |
Post the semaphore automatically. |
The ThreadLock is automatically released when the object falls out of scope.
A common use is
void func_to_protect() { ReadLock lock(threadlock); ... operation ... }
NOTE: do not declare variable as "ReadLock (threadlock)", the mutex will be released at statement end.
ost::ReadLock::ReadLock | ( | ThreadLock & | _tl | ) | [inline] |
Wait for read access.
_tl | reference to lock to aquire. |
ost::ReadLock::~ReadLock | ( | ) | [inline] |
Post the semaphore automatically.