head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.36; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.50; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.58; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.54; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# SGCondition Class Reference

A condition variable is a synchronization device that allows threads to suspend execution until some predicate on shared data is satisfied. More...

`#include <SGThread.hxx>`

List of all members.

## Public Methods
| SGCondition ()
| Create a new condition variable.
| ~SGCondition ()
| Destroy the condition object.
void | wait (SGMutex &)
| Wait for this condition variable to be signaled.
bool | wait (SGMutex &mutex, unsigned long ms)
| Wait for this condition variable to be signaled for at most 'ms' milliseconds.
void | signal ()
| Wake one thread waiting on this condition variable.
void | broadcast ()
| Wake all threads waiting on this condition variable.

## Detailed Description

A condition variable is a synchronization device that allows threads to suspend execution until some predicate on shared data is satisfied.

A condition variable is always associated with a mutex to avoid race conditions.

Definition at line 242 of file SGThread.hxx.

## Member Function Documentation

void SGCondition::broadcast | ( |  | ) | `[inline]`

| Wake all threads waiting on this condition variable. Nothing happens if no threads are waiting. Definition at line 318 of file SGThread.hxx.

void SGCondition::signal | ( |  | ) | `[inline]`

| Wake one thread waiting on this condition variable. Nothing happens if no threads are waiting. If several threads are waiting exactly one thread is restarted. It is not specified which. Definition at line 312 of file SGThread.hxx. Referenced by SGBlockingQueue< T >::push().

bool SGCondition::wait | ( | SGMutex & | mutex,
|  | unsigned long | ms
| ) |

  | Wait for this condition variable to be signaled for at most 'ms' milliseconds. Parameters:
  mutex | reference to a locked mutex.
  ms | milliseconds to wait for a signal.
Returns: Definition at line 78 of file SGThread.cxx. References SGMutex::mutex.

void SGCondition::wait | ( | SGMutex & |  | ) | `[inline]`

  | Wait for this condition variable to be signaled. Parameters:
  SGMutex& | reference to a locked mutex.
Definition at line 324 of file SGThread.hxx. References SGMutex::mutex. Referenced by SGBlockingQueue< T >::pop().

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

- SGThread.hxx
- SGThread.cxx

@ 1.3 log @Oops, try again. @ text @d154 1 a154 1 Definition at line 53 of file SGThread.cxx. d204 1 a204 1