Very Simple Cross-Platform Library
Public Member Functions | List of all members
hu::varadiistvan::scpl::CondVar Class Reference

#include <CondVar.h>

Public Member Functions

bool wait (Mutex &mutex, int timeout=-1)
 
void signal ()
 
void broadcast ()
 

Detailed Description

Condition variable.

Definition at line 48 of file CondVar.h.

Member Function Documentation

◆ broadcast()

void hu::varadiistvan::scpl::CondVar::broadcast ( )

Signal all threads waiting on the condition variable.

◆ signal()

void hu::varadiistvan::scpl::CondVar::signal ( )

Signal the condition variable to wake up one thread.

◆ wait()

bool hu::varadiistvan::scpl::CondVar::wait ( Mutex mutex,
int  timeout = -1 
)

Wait for the condition variable.

Parameters
mutexthe mutex to unlock and re-lock.
timeoutthe number of milliseconds to wait at most. If negative, the function will wait indefinitely.
Returns
true, if the condition variable was signalled, false if a timeout occured

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