libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
Cond Class Reference

A condition variable. More...

#include <Cond.h>

Public Member Functions

 Cond (const Cond &)=delete
 
Cond & operator= (const Cond &)=delete
 
void wait (Mutex &lock)
 Unlocks lock and blocks until signal() is called, then reacquires lock before returning.
 
void signal ()
 Wakes every thread currently blocked in wait() on this condition variable.
 

Protected Attributes

void * handle = nullptr
 Backend-assigned condition variable handle.
 

Detailed Description

A condition variable.

Delegates to ThreadDriver for the actual platform primitive. wait() must be called with lock already held; signal() wakes every waiter (see ThreadDriver::signalCond - there is no single-waiter wake across backends).

Definition at line 16 of file Cond.h.

Constructor & Destructor Documentation

◆ Cond()

Cond::Cond ( )

Definition at line 11 of file Cond.cpp.

◆ ~Cond()

Cond::~Cond ( )

Definition at line 17 of file Cond.cpp.

Member Function Documentation

◆ signal()

void Cond::signal ( )

Wakes every thread currently blocked in wait() on this condition variable.

Definition at line 29 of file Cond.cpp.

◆ wait()

void Cond::wait ( Mutex & lock)

Unlocks lock and blocks until signal() is called, then reacquires lock before returning.

lock must be locked by the calling thread on entry. Since signal() wakes every waiter, callers must re-check their wake condition in a loop.

Definition at line 23 of file Cond.cpp.

Member Data Documentation

◆ handle

void* Cond::handle = nullptr
protected

Backend-assigned condition variable handle.

Definition at line 35 of file Cond.h.


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