Public Member Functions | |
OFReadWriteLocker (OFReadWriteLock &lock) | |
constructor | |
~OFReadWriteLocker () | |
destructor, unlocks the mutex if necessary | |
int | rdlock () |
lock the lock for reading | |
int | wrlock () |
lock the lock for writing | |
int | tryrdlock () |
try to lock the lock for reading | |
int | trywrlock () |
try to lock the lock for writing | |
int | unlock () |
unlock the lock | |
Private Member Functions | |
OFReadWriteLocker (const OFReadWriteLocker &arg) | |
unimplemented private copy constructor | |
OFReadWriteLocker & | operator= (const OFReadWriteLocker &arg) |
unimplemented private assignment operator | |
Private Attributes | |
OFReadWriteLock & | theLock |
the lock on which we are operating | |
OFBool | locked |
did we sucessfully lock the lock? |
You can just create a local instance of this class and lock the OFReadWriteLock through it. When it is destructed it will make sure that the lock is unlocked if necessary.
Definition at line 514 of file ofthread.h.
OFReadWriteLocker::OFReadWriteLocker | ( | OFReadWriteLock & | lock | ) |
constructor
lock | the lock to associate this instance with |
int OFReadWriteLocker::rdlock | ( | ) |
lock the lock for reading
int OFReadWriteLocker::wrlock | ( | ) |
lock the lock for writing
int OFReadWriteLocker::tryrdlock | ( | ) |
try to lock the lock for reading
int OFReadWriteLocker::trywrlock | ( | ) |
try to lock the lock for writing
int OFReadWriteLocker::unlock | ( | ) |