diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-08-09 16:06:12 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-08-09 16:06:12 +0200 |
commit | 9dce327e10bffddc9dc5058f06407e8ff12389b7 (patch) | |
tree | 97c4672e8e912efbbaf1a4e1cf3077a0cfe402b4 /src/irmd/reg_api.c | |
parent | 067c5661859f6a1f75adb0bb325d1641fed221a1 (diff) | |
download | ouroboros-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.c | 5 |
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); } |