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 | |
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.
| Cond ThreadSync::idleCond |
| Mutex ThreadSync::mutex |
| Cond ThreadSync::workCond |