C4 Engine
C4 Engine API Documentation


Defined in:  C4Threads.h
Triggers a signal.

void TriggerSignal(int32 index = 0);

index The index of the signal to trigger.
The TriggerSignal function activates a specific signal inside a signal object. The signal specified by the index parameter must be in the range [0, count − 1], where count is the number of signals specified when the signal object was constructed. When the TriggerSignal function is called, any thread waiting on the signal object using the Signal::WaitSignal function is unblocked, and the return value of the Signal::WaitSignal function is the same as the index value passed to the TriggerSignal function.

It is possible to assign a signal to a thread using the Thread::SetThreadSignal function. If this is done, then the destructor for the Thread class will trigger signal 0 of the signal object to indicate to the thread's code that it should exit.
See Also