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

Bundles the mutex and pair of condition variables used by the common producer/consumer handshake between a background thread and its caller: one side sets a flag (protected by mutex) and signals workCond to wake the other; the other clears the flag and signals idleCond once it's done/idle. More...

#include <Thread.h>

Public Attributes

Mutex mutex
 Protects the flag(s) the caller shares between workCond and idleCond.
 
Cond workCond
 signalled to wake a waiter when new work/state is available
 
Cond idleCond
 signalled to wake a waiter once the other side is idle/done
 

Detailed Description

Bundles the mutex and pair of condition variables used by the common producer/consumer handshake between a background thread and its caller: one side sets a flag (protected by mutex) and signals workCond to wake the other; the other clears the flag and signals idleCond once it's done/idle.

Both conds share the single mutex that protects whatever flag(s) the caller defines. Not every user needs both directions - eg. a request that's only ever polled, never woken, can leave workCond unused.

Definition at line 140 of file Thread.h.

Member Data Documentation

◆ idleCond

Cond ThreadSync::idleCond

signalled to wake a waiter once the other side is idle/done

Definition at line 144 of file Thread.h.

◆ mutex

Mutex ThreadSync::mutex

Protects the flag(s) the caller shares between workCond and idleCond.

Definition at line 142 of file Thread.h.

◆ workCond

Cond ThreadSync::workCond

signalled to wake a waiter when new work/state is available

Definition at line 143 of file Thread.h.


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