43 #include "../rtt-config.h" 46 #ifdef ORO_OS_USE_BOOST_THREAD 48 #include <boost/thread/mutex.hpp> 49 #include <boost/thread/recursive_mutex.hpp> 50 #include <boost/date_time/posix_time/posix_time_types.hpp> 65 virtual void lock() =0;
66 virtual void unlock() =0;
67 virtual bool trylock() = 0;
68 virtual bool timedlock(
Seconds s) = 0;
85 #ifndef ORO_OS_USE_BOOST_THREAD 147 boost::timed_mutex m;
170 virtual void unlock()
180 virtual bool trylock()
192 virtual bool timedlock(
Seconds s)
194 return m.timed_lock( boost::posix_time::microseconds(
Seconds_to_nsecs(s)/1000) );
210 #ifndef ORO_OS_USE_BOOST_THREAD 272 boost::recursive_timed_mutex recm;
295 virtual void unlock()
305 virtual bool trylock()
307 return recm.try_lock();
317 virtual bool timedlock(
Seconds s)
319 return recm.timed_lock( boost::posix_time::microseconds(
Seconds_to_nsecs(s)/1000 ) );
virtual bool timedlock(Seconds s)
Lock this mutex, but don't wait longer for the lock than the specified timeout.
double Seconds
Seconds are stored as a double precision float.
int rtos_mutex_rec_lock(rt_rec_mutex_t *m)
virtual ~Mutex()
Destroy a Mutex.
int rtos_mutex_unlock(rt_mutex_t *m)
int rtos_mutex_rec_init(rt_rec_mutex_t *m)
virtual bool timedlock(Seconds s)
Lock this mutex, but don't wait longer for the lock than the specified timeout.
int rtos_mutex_rec_trylock(rt_rec_mutex_t *m)
int rtos_mutex_rec_trylock_for(rt_rec_mutex_t *m, NANO_TIME relative_time)
virtual bool trylock()
Try to lock this mutex.
An object oriented wrapper around a condition variable.
int rtos_mutex_rec_unlock(rt_rec_mutex_t *m)
virtual ~MutexRecursive()
Destroy a MutexRecursive.
int rtos_mutex_lock(rt_mutex_t *m)
int rtos_mutex_init(rt_mutex_t *m)
int rtos_mutex_destroy(rt_mutex_t *m)
int rtos_mutex_trylock(rt_mutex_t *m)
nsecs Seconds_to_nsecs(const Seconds s)
An object oriented wrapper around a non recursive mutex.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
An object oriented wrapper around a recursive mutex.
int rtos_mutex_trylock_for(rt_mutex_t *m, NANO_TIME relative_time)
Mutex()
Initialize a Mutex.
virtual bool trylock()
Try to lock this mutex.
MutexRecursive()
Initialize a recursive Mutex.
virtual ~MutexInterface()
int rtos_mutex_rec_destroy(rt_rec_mutex_t *m)