C4 Engine
C4 Engine API Documentation

class Signal

Defined in:  C4Threads.h
The Signal class encapsulates a signal object for multithreaded synchronization.
Definition

class Signal

Member Functions
Signal::TriggerSignal Triggers a signal.
Signal::WaitSignal Waits for a signal to be triggered.
Constructor

explicit Signal(int32 count = 1);

Parameters
count The number of separate signals that can be triggered. This must be a positive number less than kMaxSignalCount.
Description
The Signal class defines a platform-independent signal object that can be used for multithreaded synchronization. A signal object encapsulates up to kMaxSignalCount separate binary signals that can be individually triggered. A thread can wait on a signal object using the Signal::WaitSignal function in order to block itself until another thread activates the signal using the Signal::TriggerSignal function.
WARNING. If a signal object is destroyed while a thread is waiting on it, then the behavior is undefined.
See Also

Lock

Mutex

Thread