Resources | Resources |



Methods for creating signals

Signals can be created in the following ways:

  • By calling ISignalQ_CreateSignal() - used when notifications are to be delivered to a thread that is waiting on ISignalQ_Pop.
  • By calling ISignalFactory_CreateSignal() - used when notifications are to be delivered by invoking ISignalHandler_Notify().
  • By calling ISignalCBFactory_CreateSignal() - used when notifications are to be delivered by calling a callback function.

When a signal is created, two interfaces for the same signal are returned, ISignal and ISignalCtl:

  • ISignal is used by the server (the sender of notifications) to change signals to the "set" state.
  • ISignalCtl is used by the client (the receiver of notifications) to manage the signals it has created.

Enabling/Disabling a signal

Signals are automatically enabled upon creation. However, since signals are enabled for single service only, clients must re-enable a signal each time it is set, dispatched, and processed. ISignalCtl is used to enable or disable a signal. The client holds the signal control (ISignalCtl), not the signal itself ( ISignal).

Referencing a signal

References to signals can be held, either individually, or grouped on a signal bus. Signals can be passed to servers multiple times if desired, and multiple references can be held. The server may or may not hold a reference to the signal at all if it is able to do its work without the signal.