NVIDIA Iray: Base API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::base::Condition Class Reference

Conditions allow threads to signal an event and to wait for such a signal, respectively. More...

Public Member Functions

  Condition ()
  Constructor. More...
 
  ~Condition ()
  Destructor. More...
 
void  wait ()
  Wait for the condition to be signaled. More...
 
void  signal ()
  Signal the condition. More...
 

Detailed Description

Conditions allow threads to signal an event and to wait for such a signal, respectively.

Constructor & Destructor Documentation

mi::base::Condition::Condition ( )
inline

Constructor.

mi::base::Condition::~Condition ( )
inline

Destructor.

Member Function Documentation

void mi::base::Condition::signal ( )
inline

Signal the condition.

This will wake up one thread waiting for the condition. It does not matter if the call to signal() or wait() comes first.

Note
If there are two or more calls to signal() without a call to wait() in between (and no outstading wait() call), all calls to signal() except the first are ignored, i.e., calls to signal() do not increment some counter, but just set a flag.
void mi::base::Condition::wait ( )
inline

Wait for the condition to be signaled.

If the condition is already signaled at this time the call will return immediately.