summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-10-04 09:20:57 +0200
committerdimitri staessens <[email protected]>2017-10-04 09:24:23 +0200
commit79d9fd60237b16f40eb96fc8ed6eba7fff506636 (patch)
treee1f90f33b93a720e1a0b9cf4168508db358ba61d /src
parentb3879c020ebf038a07aed20ee91ea38f21b7bd98 (diff)
downloadouroboros-79d9fd60237b16f40eb96fc8ed6eba7fff506636.tar.gz
ouroboros-79d9fd60237b16f40eb96fc8ed6eba7fff506636.zip
irmd: Don't destroy flows before IPCPs
This allows the IPCPs to call ouroboros_fini() and clean up their buffers and drastically reduce chances of getting an assertion error that some rbuffs are not empty when shutting down the irmd.
Diffstat (limited to 'src')
-rw-r--r--src/irmd/main.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 64e4d459..84c55e93 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1703,29 +1703,8 @@ void * irm_sanitize(void * o)
if (clock_gettime(CLOCK_MONOTONIC, &now) < 0)
log_warn("Failed to get time.");
- if (irmd_get_state() != IRMD_RUNNING) {
- /* Clean up all flows first to kill mainloops */
- pthread_rwlock_wrlock(&irmd.flows_lock);
- list_for_each_safe(p, h, &irmd.irm_flows) {
- struct irm_flow * f =
- list_entry(p, struct irm_flow, next);
- list_del(&f->next);
- irm_flow_set_state(f, FLOW_NULL);
- clear_irm_flow(f);
- irm_flow_destroy(f);
- }
- pthread_rwlock_unlock(&irmd.flows_lock);
- pthread_rwlock_wrlock(&irmd.reg_lock);
- /* Clean up api entries as well */
- list_for_each_safe(p, h, &irmd.api_table) {
- struct api_entry * e =
- list_entry(p, struct api_entry, next);
- list_del(&e->next);
- api_entry_destroy(e);
- }
- pthread_rwlock_unlock(&irmd.reg_lock);
+ if (irmd_get_state() != IRMD_RUNNING)
return (void *) 0;
- }
pthread_rwlock_wrlock(&irmd.reg_lock);