summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-09 18:56:54 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-09 18:56:54 +0200
commit1c67b4cd199f9efed96468a2a2ee69fd755bcf7c (patch)
tree96fe9ca4332c43b620f64f3f7bb4550c52191a97 /src/irmd/main.c
parent8286f2ca7b237ec3ec2d9b9082f2f5d83a0fc12c (diff)
downloadouroboros-1c67b4cd199f9efed96468a2a2ee69fd755bcf7c.tar.gz
ouroboros-1c67b4cd199f9efed96468a2a2ee69fd755bcf7c.zip
irmd: Fix some locking issues
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 58535e27..8503fcfa 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -787,10 +787,10 @@ static int flow_alloc_resp(pid_t n_api,
return -1;
}
- registry_del_api(&irmd->registry, n_api);
-
pthread_mutex_unlock(&rne->state_lock);
+ registry_del_api(&irmd->registry, n_api);
+
pthread_rwlock_unlock(&irmd->reg_lock);
if (!response) {
@@ -1401,10 +1401,11 @@ void * irm_flow_cleaner()
}
pthread_rwlock_unlock(&irmd->flows_lock);
- pthread_rwlock_wrlock(&irmd->reg_lock);
registry_sanitize_apis(&irmd->registry);
+ pthread_rwlock_wrlock(&irmd->reg_lock);
+
list_for_each_safe(pos, n, &irmd->spawned_apis) {
struct spawned_api * api =
list_entry(pos, struct spawned_api, next);