diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-02-16 14:27:07 +0100 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-02-16 14:27:07 +0100 |
commit | a69bdb85b2fb8f096f40ab038a45e0bc134e51ee (patch) | |
tree | 0bf7d774c73a354b1e72b429fe9bdefa56cdb14b /src | |
parent | b56b15e89e524b6e81f9794a7faad42d9b548660 (diff) | |
download | ouroboros-a69bdb85b2fb8f096f40ab038a45e0bc134e51ee.tar.gz ouroboros-a69bdb85b2fb8f096f40ab038a45e0bc134e51ee.zip |
irmd: Fix bad lock
Diffstat (limited to 'src')
-rw-r--r-- | src/irmd/main.c | 8 |
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); |