From 380837a8e9677220f706113b9b34e40a5b40c5d8 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 1 Sep 2016 04:58:57 +0200 Subject: lib, rdrbuff: Fix fast path lockup Adds missing condition signals. --- src/lib/shm_rdrbuff.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/shm_rdrbuff.c b/src/lib/shm_rdrbuff.c index 0587a8b9..96f54bd5 100644 --- a/src/lib/shm_rdrbuff.c +++ b/src/lib/shm_rdrbuff.c @@ -355,14 +355,17 @@ void * shm_rdrbuff_sanitize(void * o) garbage_collect(rdrb); - if (shm_rdrb_empty(rdrb)) + if (shm_rdrb_empty(rdrb)) { + pthread_cond_broadcast(rdrb->healthy); continue; + } api = get_tail_ptr(rdrb)->dst_api; if (kill(api, 0)) { LOG_DBGF("Dead process %d left stale sdu.", api); clean_sdus(rdrb, api); + pthread_cond_broadcast(rdrb->healthy); continue; } @@ -385,6 +388,7 @@ void * shm_rdrbuff_sanitize(void * o) clean_sdus(rdrb, api); } } + pthread_cond_broadcast(rdrb->healthy); } pthread_cleanup_pop(true); @@ -681,7 +685,6 @@ int shm_rdrbuff_remove(struct shm_rdrbuff * rdrb, ssize_t idx) *rdrb->choked = 0; pthread_cond_broadcast(rdrb->healthy); - pthread_mutex_unlock(rdrb->lock); return 0; -- cgit v1.2.3