summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-09 14:27:42 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-09 14:27:42 +0200
commitf941ec364b6f97c3861a46bd2c3b629dc2eec860 (patch)
tree598369c7c542289b359d390448f4b2bdd6b2ff47 /src
parent1dde324905796df4d7e468d7f0de027bb8dcedae (diff)
parent88804db41aebf0075354e5ad6d7491d2fa08cf25 (diff)
downloadouroboros-f941ec364b6f97c3861a46bd2c3b629dc2eec860.tar.gz
ouroboros-f941ec364b6f97c3861a46bd2c3b629dc2eec860.zip
Merged in dstaesse/ouroboros/be-bugfixing (pull request #192)
irmd: Fix bad locking
Diffstat (limited to 'src')
-rw-r--r--src/irmd/irm_flow.c1
-rw-r--r--src/irmd/reg_api.c4
2 files changed, 1 insertions, 4 deletions
diff --git a/src/irmd/irm_flow.c b/src/irmd/irm_flow.c
index 6531e4f6..bf67f2ce 100644
--- a/src/irmd/irm_flow.c
+++ b/src/irmd/irm_flow.c
@@ -64,7 +64,6 @@ void irm_flow_destroy(struct irm_flow * f)
f->state = FLOW_NULL;
pthread_cond_signal(&f->state_cond);
- pthread_mutex_unlock(&f->state_lock);
pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock,
(void *) &f->state_lock);
diff --git a/src/irmd/reg_api.c b/src/irmd/reg_api.c
index e2da1244..d50f89e8 100644
--- a/src/irmd/reg_api.c
+++ b/src/irmd/reg_api.c
@@ -56,8 +56,6 @@ void reg_api_destroy(struct reg_api * i)
pthread_cond_signal(&i->state_cond);
- pthread_mutex_unlock(&i->state_lock);
-
pthread_cleanup_push((void(*)(void *)) pthread_mutex_unlock,
(void *) &i->state_lock);
@@ -75,7 +73,7 @@ void reg_api_destroy(struct reg_api * i)
static void cleanup_sleeper(void * o) {
struct reg_api * i = (struct reg_api *) o;
i->state = REG_I_NULL;
- pthread_cond_signal(&i->state_cond);
+ pthread_cond_broadcast(&i->state_cond);
pthread_mutex_unlock(&i->state_lock);
}