1 #ifndef COIN_SBRWMUTEX_H
2 #define COIN_SBRWMUTEX_H
36 #include <Inventor/C/threads/rwmutex.h>
46 this->rwmutex = cc_rwmutex_construct_etc(
47 (policy == WRITE_PRECEDENCE)? CC_WRITE_PRECEDENCE : CC_READ_PRECEDENCE);
49 ~
SbRWMutex(
void) { cc_rwmutex_destruct(this->rwmutex); }
52 return cc_rwmutex_write_lock(this->rwmutex) == CC_OK ? 0 : 1;
54 SbBool tryWriteLock(
void) {
55 return cc_rwmutex_write_try_lock(this->rwmutex) == CC_OK;
57 int writeUnlock(
void) {
58 return cc_rwmutex_write_unlock(this->rwmutex) == CC_OK ? 0 : 1;
62 return cc_rwmutex_read_lock(this->rwmutex) == CC_OK ? 0 : 1;
64 int tryReadLock(
void) {
65 return cc_rwmutex_read_try_lock(this->rwmutex) == CC_OK;
67 int readUnlock(
void) {
68 return cc_rwmutex_read_unlock(this->rwmutex) == CC_OK ? 0 : 1;
75 #endif // !COIN_SBRWMUTEX_H
struct cc_rwmutex cc_rwmutex
The type definition for the read-write mutex structure.
Definition: common.h:59
Definition: SbRWMutex.h:38