summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2017-02-16 14:27:07 +0100
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2017-02-16 14:27:07 +0100
commita69bdb85b2fb8f096f40ab038a45e0bc134e51ee (patch)
tree0bf7d774c73a354b1e72b429fe9bdefa56cdb14b /src
parentb56b15e89e524b6e81f9794a7faad42d9b548660 (diff)
downloadouroboros-a69bdb85b2fb8f096f40ab038a45e0bc134e51ee.tar.gz
ouroboros-a69bdb85b2fb8f096f40ab038a45e0bc134e51ee.zip
irmd: Fix bad lock
Diffstat (limited to 'src')
-rw-r--r--src/irmd/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index aa4614c1..7f20faf4 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1393,11 +1393,11 @@ static struct irm_flow * flow_req_arr(pid_t api,
pthread_rwlock_unlock(&irmd->reg_lock);
pthread_rwlock_unlock(&irmd->state_lock);
- if (reg_entry_leave_state(re, REG_NAME_AUTO_EXEC, NULL)) {
- pthread_rwlock_unlock(&irmd->reg_lock);
- pthread_rwlock_unlock(&irmd->state_lock);
+ if (reg_entry_leave_state(re, REG_NAME_AUTO_EXEC, NULL))
return NULL;
- }
+
+ pthread_rwlock_rdlock(&irmd->state_lock);
+ pthread_rwlock_wrlock(&irmd->reg_lock);
case REG_NAME_FLOW_ACCEPT:
h_api = reg_entry_get_api(re);