40 InitializeCriticalSection(&lock_);
45 DeleteCriticalSection(&lock_);
63 EnterCriticalSection(&lock_);
68 LeaveCriticalSection(&lock_);
73 #if defined(MSDEV_2003) || defined(MSDEV_2005) 74 EnterCriticalSection(&lock_);
77 return 0 != TryEnterCriticalSection(&lock_);
82 CRITICAL_SECTION lock_;
93 explicit RWLock(
const pthread_rwlockattr_t *attr = 0)
95 pthread_rwlock_init(&rwlock_, attr);
101 pthread_rwlock_destroy(&rwlock_);
107 pthread_rwlock_wrlock(&rwlock_);
113 return 0 == pthread_rwlock_trywrlock(&rwlock_);
119 pthread_rwlock_rdlock(&rwlock_);
125 return 0 == pthread_rwlock_tryrdlock(&rwlock_);
131 pthread_rwlock_unlock(&rwlock_);
142 pthread_rwlock_t rwlock_;
191 #endif // RW_LOCK_HPP RWLock(const pthread_rwlockattr_t *attr=0)
constructor (acquires the lock)
Definition: rwlock.hpp:93
ScopedReadLock(RWLock &rwlock)
constructor - locks the object
Definition: rwlock.hpp:154
void wrlock()
acquire rw lock
Definition: rwlock.hpp:105
ScopedWriteLock(RWLock &rwlock)
constructor - locks the object
Definition: rwlock.hpp:176
~ScopedReadLock()
destructor - unlocks the object used in constructor
Definition: rwlock.hpp:161
bool trywrlock()
test to see if the rw lock can be acquired
Definition: rwlock.hpp:111
Class to provide a Read-Write Lock.
Definition: rwlock.hpp:89
~ScopedWriteLock()
destructor - unlocks the object used in constructor
Definition: rwlock.hpp:183
void unlock()
release rw lock
Definition: rwlock.hpp:129
void rdlock()
acquire rd lock
Definition: rwlock.hpp:117
~RWLock()
constructor (releases lock)
Definition: rwlock.hpp:99
void wrunlock()
unlock rw lock
Definition: rwlock.hpp:138
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
bool tryrdlock()
test to see if the rd lock can be acquired
Definition: rwlock.hpp:123
void rdunlock()
unlock rd lock
Definition: rwlock.hpp:135
Class to provide a ScopedWriteLock. The lock is applied by the constructor and released by the destru...
Definition: rwlock.hpp:172
Class to provide a ScopedReadLock. The lock is applied by the constructor and released by the destruc...
Definition: rwlock.hpp:150