summaryrefslogtreecommitdiff
path: root/src/irmd/reg_api.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-09 16:06:12 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-09 16:06:12 +0200
commit9dce327e10bffddc9dc5058f06407e8ff12389b7 (patch)
tree97c4672e8e912efbbaf1a4e1cf3077a0cfe402b4 /src/irmd/reg_api.c
parent067c5661859f6a1f75adb0bb325d1641fed221a1 (diff)
downloadouroboros-9dce327e10bffddc9dc5058f06407e8ff12389b7.tar.gz
ouroboros-9dce327e10bffddc9dc5058f06407e8ff12389b7.zip
lib: Various fixes
Fix missing set of api upon flow_alloc. Various locking 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);
}