summaryrefslogtreecommitdiff
path: root/src/lib/shm_rdrbuff.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-09-01 04:58:57 +0200
committerdimitri staessens <[email protected]>2016-09-01 05:00:52 +0200
commit380837a8e9677220f706113b9b34e40a5b40c5d8 (patch)
tree740372c4ac50a314f3f7bdb9eeb40a823f199bfb /src/lib/shm_rdrbuff.c
parent28fe806163bfabd08dcfbe5de7bd84431453c9de (diff)
downloadouroboros-380837a8e9677220f706113b9b34e40a5b40c5d8.tar.gz
ouroboros-380837a8e9677220f706113b9b34e40a5b40c5d8.zip
lib, rdrbuff: Fix fast path lockup
Adds missing condition signals.
Diffstat (limited to 'src/lib/shm_rdrbuff.c')
-rw-r--r--src/lib/shm_rdrbuff.c7
1 files changed, 5 insertions, 2 deletions
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;