-/* FSM is uninitialized through scheduler to make sure that all dying
- real system threads will have their finish callbacks scheduled before
- this one (when SILC_FSM_THREAD_WAIT was used). */
-
-SILC_TASK_CALLBACK(silc_fsm_uninit_final)
-{
- SilcFSM f = context;
-
-#if defined(SILC_DEBUG)
- /* Machine must not have active threads */
- if (!f->thread && f->u.m.threads)
- assert(f->u.m.threads == 0);
-#endif /* SILC_DEBUG */
-
- if (!f->thread && f->u.m.lock)
- silc_mutex_free(f->u.m.lock);
-
- if (f->thread && f->u.t.sema)
- silc_fsm_sema_free(f->u.t.sema);
-}
-
-/* Uninitializes FSM */
-
-void silc_fsm_uninit(void *fsm)
-{
- SilcFSM f = fsm;
- silc_schedule_task_add_timeout(f->schedule, silc_fsm_uninit_final, f, 0, 1);
-}
-