diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2017-02-16 14:45:07 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-02-16 14:45:07 +0000 |
commit | 8cb5218438feaf455a297915d037675e3c3eea21 (patch) | |
tree | 0bf7d774c73a354b1e72b429fe9bdefa56cdb14b /src/irmd/main.c | |
parent | b56b15e89e524b6e81f9794a7faad42d9b548660 (diff) | |
parent | a69bdb85b2fb8f096f40ab038a45e0bc134e51ee (diff) | |
download | ouroboros-8cb5218438feaf455a297915d037675e3c3eea21.tar.gz ouroboros-8cb5218438feaf455a297915d037675e3c3eea21.zip |
Merged in dstaesse/ouroboros/be-irmd (pull request #377)
irmd: Fix bad lock
Diffstat (limited to 'src/irmd/main.c')
-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); |