Scopira 20080306

scopira::tool::condition Class Reference

#include <thread_pthreads.h>

List of all members.

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

Detailed Description

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.

Author:
Aleksander Demko

Constructor & Destructor Documentation

scopira::tool::condition::condition ( void  )

constructor

scopira::tool::condition::condition ( void  )

constructor


Member Function Documentation

void scopira::tool::condition::notify ( void  )

Notify One waiting thread You don't need to do any mutex locking for this.

Author:
Aleksander Demko

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.

Author:
Aleksander Demko
void scopira::tool::condition::notify_all ( void  )

Notify ALL the waiting threads. You don't need to do any mutex locking for this.

Author:
Aleksander Demko

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.

Author:
Aleksander Demko
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.

Parameters:
mutthe mutex that has been locked on entry
msecthe number of msec (1000=second) to wait
Returns:
true if timed out, false if got a notification event
Author:
Aleksander Demko
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.

Parameters:
mutthe mutex that has been locked on entry
msecthe number of msec (1000=second) to wait
Returns:
true if timed out, false if got a notification event
Author:
Aleksander Demko
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.

Author:
Aleksander Demko

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.

Author:
Aleksander Demko

The documentation for this class was generated from the following files: