QoreCondition Class Reference

a thread condition class implementing a wrapper for pthread_cond_t More...

#include <QoreCondition.h>

List of all members.

Public Member Functions

DLLEXPORT QoreCondition ()
 creates the condition object
DLLEXPORT ~QoreCondition ()
 destroys the condition object
DLLEXPORT int signal ()
 signals a single waiting thread to wake up
DLLEXPORT int broadcast ()
 singles all threads blocked on this condition to wake up
DLLEXPORT int wait (pthread_mutex_t *m)
 blocks a thread on a mutex until the condition is signaled
DLLEXPORT int wait (pthread_mutex_t *m, int timeout_ms)
 blocks a thread on a mutex for a certain number of milliseconds until the condition is signaled
DLLEXPORT int wait (QoreThreadLock *l)
 blocks a thread on a lock until the condition is signaled
DLLEXPORT int wait (QoreThreadLock *l, int timeout)
 blocks a thread on a lock for a certain number of milliseconds until the condition is signaled
DLLEXPORT int wait (QoreThreadLock &l)
 blocks a thread on a lock until the condition is signaled
DLLEXPORT int wait (QoreThreadLock &l, int timeout)
 blocks a thread on a lock for a certain number of milliseconds until the condition is signaled

Detailed Description

a thread condition class implementing a wrapper for pthread_cond_t

all threads that block on a given QoreCondition object should use the same mutex or QoreThreadLock object for blocking

See also:
QoreThreadLock

Member Function Documentation

DLLEXPORT int QoreCondition::wait ( QoreThreadLock l,
int  timeout 
) [inline]

blocks a thread on a lock for a certain number of milliseconds until the condition is signaled

Parameters:
l the QoreThreadLock to wait on
timeout the timeout value is milliseconds
Returns:
a non-zero return value indicates a timeout occured

References wait().

Referenced by wait().

DLLEXPORT int QoreCondition::wait ( QoreThreadLock l  )  [inline]

blocks a thread on a lock until the condition is signaled

Parameters:
l the QoreThreadLock to wait on
Returns:
0 for success, non-zero for error

References wait().

Referenced by wait().

DLLEXPORT int QoreCondition::wait ( QoreThreadLock l,
int  timeout 
) [inline]

blocks a thread on a lock for a certain number of milliseconds until the condition is signaled

Parameters:
l the QoreThreadLock to wait on
timeout the timeout value is milliseconds
Returns:
a non-zero return value indicates a timeout occured

References wait().

Referenced by wait().

DLLEXPORT int QoreCondition::wait ( QoreThreadLock l  )  [inline]

blocks a thread on a lock until the condition is signaled

Parameters:
l the QoreThreadLock to wait on
Returns:
0 for success, non-zero for error

References wait().

Referenced by wait().

DLLEXPORT int QoreCondition::wait ( pthread_mutex_t *  m,
int  timeout_ms 
)

blocks a thread on a mutex for a certain number of milliseconds until the condition is signaled

Parameters:
m the mutext to wait on
timeout_ms the timeout value is milliseconds
Returns:
a non-zero return value indicates a timeout occured
DLLEXPORT int QoreCondition::wait ( pthread_mutex_t *  m  ) 

blocks a thread on a mutex until the condition is signaled

Parameters:
m the mutex to wait on
Returns:
0 for success, non-zero for error

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

Generated on 14 Jun 2010 for Qore Programming Language by  doxygen 1.6.1