Commit 8e78ee7b authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Fix termination steps

parent b10266ef
......@@ -260,9 +260,6 @@ int fd_disp_fini(void)
/* Then if needed, cancel the thread */
/* Remove all remaining handlers */
fd_disp_unregister_all();
return ENOTSUP;
}
......@@ -107,6 +107,12 @@ int fd_dict_base_protocol(struct dictionary * dict);
/* Routing */
int fd_rt_init(void);
int fd_rt_fini(void);
int fd_rt_cleanup(void);
/* Dispatch */
int fd_disp_init(void);
int fd_disp_cleanstop(void);
int fd_disp_fini(void);
/* Sentinel for the sent requests list */
struct sr_list {
......
......@@ -169,6 +169,9 @@ end:
CHECK_FCT_DO( fd_ext_fini(), /* Cleaup all extensions */ );
TODO("Cleanup queues (dump all remaining messages ?)");
CHECK_FCT_DO( fd_rt_cleanup(), /* destroy remaining handlers */ );
fd_disp_unregister_all(); /* destroy remaining handlers */
CHECK_FCT_DO( fd_thr_term(&sig_th), /* continue */ );
......
......@@ -859,12 +859,18 @@ int fd_rt_init(void)
return 0;
}
/* Terminate the routing module */
/* Terminate the routing threads */
int fd_rt_fini(void)
{
CHECK_FCT_DO( fd_thr_term(&rt_in ), /* continue */);
CHECK_FCT_DO( fd_thr_term(&rt_out), /* continue */);
return 0;
}
/* Cleanup handlers */
int fd_rt_cleanup(void)
{
/* Cleanup all remaining handlers */
while (!FD_IS_LIST_EMPTY(&rt_fwd_list)) {
CHECK_FCT_DO( fd_rt_fwd_unregister ( (void *)rt_fwd_list.next, NULL ), /* continue */ );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment