+SILC_FSM_STATE(test_st_wait1)
+{
+ Foo f = fsm_context;
+
+ SILC_LOG_DEBUG(("Waiter 1"));
+ SILC_FSM_EVENT_WAIT(&f->wait2);
+ SILC_LOG_DEBUG(("Waiter 1 signalled"));
+ f->got_wait1 = 1;
+ return SILC_FSM_FINISH;
+}
+
+SILC_FSM_STATE(test_st_wait2)
+{
+ Foo f = fsm_context;
+
+ SILC_LOG_DEBUG(("Waiter 2"));
+ SILC_FSM_EVENT_WAIT(&f->wait2);
+ SILC_LOG_DEBUG(("Waiter 2 signalled"));
+ f->got_wait2 = 1;
+ return SILC_FSM_FINISH;
+}
+
+SILC_FSM_STATE(test_st_signal1)
+{
+ Foo f = fsm_context;
+
+ SILC_LOG_DEBUG(("Signaller 1"));
+ SILC_FSM_EVENT_SIGNAL(&f->wait2);
+ silc_fsm_next_later(fsm, test_st_signal1_check, 0, 500000);
+ return SILC_FSM_WAIT;;
+}
+
+SILC_FSM_STATE(test_st_signal1_check)
+{
+ Foo f = fsm_context;
+
+ SILC_LOG_DEBUG(("Signal check"));
+ assert(f->got_wait1 && f->got_wait2);
+ return SILC_FSM_FINISH;
+}
+