SILC_FSM_THREAD_WAIT

NAME

    SILC_FSM_THREAD_WAIT(thread)

DESCRIPTION

Macro used to wait for the `thread' to terminate. The machine or thread will be suspended while it is waiting for the thread to terminate. The machine or thread will continue once the waited thread has terminated.

NOTES

The state function returns in this macro.

This macro is the only way to safely make sure that the thread has terminated by the time FSM continues from the waiting state. Using FSM events to signal from the thread before SILC_FSM_FINISH is returned works with normal FSM threads, but especially with real system threads it does not guarantee that the FSM won't continue before the thread has actually terminated. Usually this is not a problem, but it can be a problem if the FSM is waiting to be freed. In this case using this macro is strongly recommended.