27 #ifndef CPP_PTHREADS_MUTEX_H_
28 #define CPP_PTHREADS_MUTEX_H_
Points to a locked mutex and unlocks the mutex when destroyed.
int unlock()
unlock the mutex after a successful lock
int getPriorityCeiling(int &)
get the priority ceiling
int setPriorityCeiling(int newCeil, int *oldCeil)
change the priority ceiling
void swap(ScopedLock &other)
swaps mutexes with another lock
~ScopedLock()
move constructor transfers ownership of the lock to the new object
int trylock()
try to lock the mutex, but dont block
int lock()
lock the mutex, block until succeed
ScopedLock(Mutex *mutex=0)
default constructor has an empty mutex
Mutex * m_mutex
< the mutex being locked
BinaryKey other(const BinaryKey &key)
int init()
calls pthread_mutex_init
int destroy()
calls pthread_mutex_destroy
Attributes object for type Base.
ScopedLock & operator=(ScopedLock &other)
assignment transfers ownership of the lock to the assignee
ScopedLock scopedLock()
return a scoped lock
Allows multiple threads to wait until a condition is satisfied.