diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-10-04 09:20:57 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-10-04 09:24:23 +0200 |
commit | 79d9fd60237b16f40eb96fc8ed6eba7fff506636 (patch) | |
tree | e1f90f33b93a720e1a0b9cf4168508db358ba61d | |
parent | b3879c020ebf038a07aed20ee91ea38f21b7bd98 (diff) | |
download | ouroboros-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.
-rw-r--r-- | src/irmd/main.c | 23 |
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); |