summaryrefslogtreecommitdiff
path: root/src/irmd/reg_api.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-09 16:14:33 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-09 16:14:33 +0200
commitf558d4404a9cb5b87ce3e239d8c0712bbaaba39a (patch)
tree8414f9e0d72910c4115bd9bce4e2cd4e0e52a465 /src/irmd/reg_api.c
parentd7a3ac1eae57404630b39ad68b548910c88ed150 (diff)
parent9dce327e10bffddc9dc5058f06407e8ff12389b7 (diff)
downloadouroboros-f558d4404a9cb5b87ce3e239d8c0712bbaaba39a.tar.gz
ouroboros-f558d4404a9cb5b87ce3e239d8c0712bbaaba39a.zip
Merged in dstaesse/ouroboros/be-bugfixing (pull request #195)
lib: Various fixes
Diffstat (limited to 'src/irmd/reg_api.c')
-rw-r--r--src/irmd/reg_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/irmd/reg_api.c b/src/irmd/reg_api.c
index d50f89e8..648dc1b3 100644
--- a/src/irmd/reg_api.c
+++ b/src/irmd/reg_api.c
@@ -111,8 +111,11 @@ void reg_api_wake(struct reg_api * i)
pthread_cond_broadcast(&i->state_cond);
+ pthread_cleanup_push((void(*)(void *)) pthread_mutex_unlock,
+ (void *) &i->state_lock);
+
while (i->state == REG_I_WAKE)
pthread_cond_wait(&i->state_cond, &i->state_lock);
- pthread_mutex_unlock(&i->state_lock);
+ pthread_cleanup_pop(true);
}