summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-05-17 19:43:50 +0200
committerSander Vrijders <[email protected]>2016-05-17 19:43:50 +0200
commit950bc6a4c195e8751ada64c7c9a3f842adbc23c5 (patch)
treee1eb73d549546f3024c783e8910c62dcbe39860e /src/irmd/main.c
parent8130973653ec66fc8cc7a35f8fe4d3d19750ad50 (diff)
parentd3e754a729fcbf684b00799412fbcb7db41cf192 (diff)
downloadouroboros-950bc6a4c195e8751ada64c7c9a3f842adbc23c5.tar.gz
ouroboros-950bc6a4c195e8751ada64c7c9a3f842adbc23c5.zip
Merged in dstaesse/ouroboros/be (pull request #97)
irmd: fixed bad locks
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c6
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;
}