silc_fsm_event_alloc

SYNOPSIS

    SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm);

DESCRIPTION

Allocates asynchronous FSM event. FSM events are asynchronous events that can be waited and signalled. They can be used as condition variables and signallers. They can be used for example to wait that some event happens, some thread moves to a specific state or similar. The FSM Events may also be used in FSM threads that are executed in real system threads. It is safe to wait and signal the event from threads. The `fsm' must be the machine, not a thread. Returns NULL if system is out of memory or `fsm' is not FSM machine.

Use the macros SILC_FSM_EVENT_WAIT and SILC_FSM_EVENT_TIMEDWAIT to wait for the event. Use the SILC_FSM_EVENT_SIGNAL macro to signal all the waiters.