Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Creating signals with ISignalQ

Clients that dispatch their own signals manually use ISignalQ_CreateSignal() to create the signals, and use ISignalQ_Pop() to wait for notifications. Since ISignalQ_Pop() is a blocking call, it should be used for simple applications where the client has no work to do other than waiting for the signal notification, or where the client creates a thread dedicated to dispatching signal notifications.

Sequence

The following figure shows the sequence diagram for a signal queue.

SignalQ

The events events shown in sequence diagram are as follows:

  1. The client creates a signal using ISignalQ_CreateSignal().
  2. The client passes the signal to the server to request notification when an event occurs.
  3. The client then waits for notification using ISignalQ_Pop(), which blocks thread execution.
  4. The server sets the signal using ISignal_Set() when the desired state is reached.
  5. When notification occurs, the signal is disabled until the client re-enables the signal using the ISignalCtl_Enable().
  6. If the signal is no longer desired, it is detached using ISignalCtl_Detach().