SILC_FSM_EVENT_WAIT
NAME
SILC_FSM_EVENT_WAIT(event)
DESCRIPTION
Macro used to wait for the `event' to be signalled. The machine
or thread will be suspended while it is waiting for the event.
This macro can only be used in FSM state functions. When the
event is signalled the FSM will re-enter the current state (or
state that was set with silc_fsm_next before waiting).
EXAMPLE
// Signalling example
ctx->async_event = silc_fsm_event_alloc(fsm);
...
SILC_FSM_STATE(silc_foo_state)
{
...
// Wait here for async call to complete
SILC_FSM_EVENT_WAIT(ctx->async_event);
// Async call completed
if (ctx->async_success == FALSE)
fatal(error);
...
}
|