diff options
author | dimitri staessens <[email protected]> | 2016-08-09 12:07:20 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-08-09 12:07:20 +0200 |
commit | 88804db41aebf0075354e5ad6d7491d2fa08cf25 (patch) | |
tree | 598369c7c542289b359d390448f4b2bdd6b2ff47 /src/irmd/reg_api.c | |
parent | 1dde324905796df4d7e468d7f0de027bb8dcedae (diff) | |
download | ouroboros-88804db41aebf0075354e5ad6d7491d2fa08cf25.tar.gz ouroboros-88804db41aebf0075354e5ad6d7491d2fa08cf25.zip |
irmd: Fix bad locking
Locks should be kept before calling cond_wait.
Diffstat (limited to 'src/irmd/reg_api.c')
-rw-r--r-- | src/irmd/reg_api.c | 4 |
1 files changed, 1 insertions, 3 deletions
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); } |