diff options
author | Dimitri Staessens <[email protected]> | 2018-10-11 20:27:32 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-10-11 20:27:32 +0200 |
commit | 1ee129f4479b1910afc929f24bb70b8bc6478f01 (patch) | |
tree | f899381d05ed5f322829bc478c9e3517cf1f9184 /src/lib | |
parent | 6856f3e24fa00b99747bab790b478866212b2e2d (diff) | |
parent | 558fc46c63d28ce2ffd0abc5c737f49cc185ba82 (diff) | |
download | ouroboros-1ee129f4479b1910afc929f24bb70b8bc6478f01.tar.gz ouroboros-1ee129f4479b1910afc929f24bb70b8bc6478f01.zip |
Merge branch 'testing' into be
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/notifier.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/notifier.c b/src/lib/notifier.c index 593a0e70..4f77f2e3 100644 --- a/src/lib/notifier.c +++ b/src/lib/notifier.c @@ -75,12 +75,15 @@ void notifier_event(int event, pthread_rwlock_rdlock(¬ifier.lock); + pthread_cleanup_push((void (*) (void *)) pthread_rwlock_unlock, + (void *) ¬ifier.lock) + list_for_each(p, ¬ifier.listeners) { struct listener * l = list_entry(p, struct listener, next); l->callback(l->obj, event, o); } - pthread_rwlock_unlock(¬ifier.lock); + pthread_cleanup_pop(true); } int notifier_reg(notifier_fn_t callback, |