20 #if !defined(__MITSUBA_CORE_LOCK_H_)
21 #define __MITSUBA_CORE_LOCK_H_
23 #include <mitsuba/mitsuba.h>
25 #include <boost/scoped_ptr.hpp>
52 boost::scoped_ptr<MutexPrivate> d;
72 const bool &
get()
const;
96 struct WaitFlagPrivate;
97 boost::scoped_ptr<WaitFlagPrivate> d;
159 struct ConditionVariablePrivate;
160 boost::scoped_ptr<ConditionVariablePrivate> d;
182 explicit LockGuard(LockGuard&);
183 LockGuard& operator=(LockGuard&);
195 : m(mutex), is_locked(false) {
206 SAssert(!ownsLock() && m != NULL);
212 SAssert(ownsLock() && m != NULL);
218 Mutex *
const mutex = m;
219 m =
static_cast<Mutex*
>(NULL);
Mutex * release()
Definition: lock.h:217
bool ownsLock() const
Definition: lock.h:228
Condition variable synchronization primitive. Can be used to wait for a condition to become true in a...
Definition: lock.h:106
UniqueLock(Mutex *mutex, bool acquire_lock=true)
Definition: lock.h:194
#define MTS_EXPORT_CORE
Definition: getopt.h:29
void unlock()
Definition: lock.h:211
Simple RAII-style locking of a Mutex. On construction it locks the mutex and unlocks it on destructio...
Definition: lock.h:170
~UniqueLock()
Definition: lock.h:200
#define SAssert(cond)
``Static'' assertion (to be used outside of classes that derive from Object)
Definition: logger.h:79
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
bool operator!() const
Definition: lock.h:224
LockGuard(Mutex *m_)
Definition: lock.h:172
Wait flag synchronization primitive. Can be used to wait for a certain event to occur.
Definition: lock.h:61
void lock()
Definition: lock.h:205
Parent of all Mitsuba classes.
Definition: object.h:38
~LockGuard()
Definition: lock.h:176
Thin wrapper around the recursive boost thread lock.
Definition: lock.h:34
In addition to providing RAII-style locking, UniqueLock also allows for deferred locking until lock()...
Definition: lock.h:192