diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-05-17 19:14:11 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-05-17 19:14:11 +0200 |
commit | d3e754a729fcbf684b00799412fbcb7db41cf192 (patch) | |
tree | e1eb73d549546f3024c783e8910c62dcbe39860e | |
parent | 8130973653ec66fc8cc7a35f8fe4d3d19750ad50 (diff) | |
download | ouroboros-d3e754a729fcbf684b00799412fbcb7db41cf192.tar.gz ouroboros-d3e754a729fcbf684b00799412fbcb7db41cf192.zip |
irmd: fixed bad locks
-rw-r--r-- | src/irmd/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 6030f0b1..89263977 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -620,7 +620,7 @@ static int reg_ipcp(instance_name_t * api, return -1; } - rw_lock_wrlock(&instance->reg_lock); + rw_lock_unlock(&instance->reg_lock); rw_lock_unlock(&instance->state_lock); return 0; @@ -849,8 +849,6 @@ static struct port_map_entry * flow_accept(pid_t pid, /* ap with pending accept being unregistered */ if (rne->flow_arrived == -2 ) { pthread_mutex_unlock(&rne->acc_lock); - rw_lock_unlock(&instance->reg_lock); - rw_lock_unlock(&instance->state_lock); return NULL; } @@ -996,7 +994,7 @@ static struct port_map_entry * flow_alloc(pid_t pid, list_del(&pme->next); bmp_release(instance->port_ids, pme->port_id); rw_lock_unlock(&instance->flows_lock); - rw_lock_rdlock(&instance->state_lock); + rw_lock_unlock(&instance->state_lock); free(pme); return NULL; } |