|
Scopira
20080306
|
#include <thread_pthreads.h>
Public Member Functions | |
| condition (void) | |
| ~condition () | |
| non virtual dtor | |
| void | notify (void) |
| void | notify_all (void) |
| void | wait (mutex &mut) |
| bool | wait (mutex &mut, int msec) |
| condition (void) | |
| ~condition () | |
| non virtual dtor | |
| void | notify (void) |
| void | notify_all (void) |
| void | wait (mutex &mut) |
| bool | wait (mutex &mut, int msec) |
Protected Attributes | |
| pthread_cond_t | dm_con |
| QWaitCondition | dm_con |
A condition (short for ‘‘condition variable’’) is a synchronization device that allows threads to suspend execution and relinquish the pro- cessors until some predicate on shared data is satisfied. The basic operations on conditions are: signal the condition (when the predicate becomes true), and wait for the condition, suspending the thread execu- tion until another thread signals the condition.
| scopira::tool::condition::condition | ( | void | ) |
constructor
| scopira::tool::condition::condition | ( | void | ) |
constructor
| void scopira::tool::condition::notify | ( | void | ) |
Notify One waiting thread You don't need to do any mutex locking for this.
Referenced by scopira::tool::event_ptr< T >::notify().
| void scopira::tool::condition::notify | ( | void | ) |
Notify One waiting thread You don't need to do any mutex locking for this.
| void scopira::tool::condition::notify_all | ( | void | ) |
Notify ALL the waiting threads. You don't need to do any mutex locking for this.
Referenced by scopira::tool::event_ptr< T >::notify_all().
| void scopira::tool::condition::notify_all | ( | void | ) |
Notify ALL the waiting threads. You don't need to do any mutex locking for this.
| void scopira::tool::condition::wait | ( | mutex & | mut | ) |
Waits, indefinatly for a notification. You must have a lock on the given mutex before calling this method. The method does a quick unlock before waiting, and reaquires the lock on notification.
Referenced by scopira::tool::event_ptr< T >::wait().
| void scopira::tool::condition::wait | ( | mutex & | mut | ) |
Waits, indefinatly for a notification. You must have a lock on the given mutex before calling this method. The method does a quick unlock before waiting, and reaquires the lock on notification.
| bool scopira::tool::condition::wait | ( | mutex & | mut, |
| int | msec | ||
| ) |
Waits, indefinatly for a notification. You must have a lock on the given mutex before calling this method. The method does a quick unlock before waiting, and reaquires the lock on notification.
| mut | the mutex that has been locked on entry |
| msec | the number of msec (1000=second) to wait |
| bool scopira::tool::condition::wait | ( | mutex & | mut, |
| int | msec | ||
| ) |
Waits, indefinatly for a notification. You must have a lock on the given mutex before calling this method. The method does a quick unlock before waiting, and reaquires the lock on notification.
| mut | the mutex that has been locked on entry |
| msec | the number of msec (1000=second) to wait |