From 6986c70888a1a84a434e9a6ff640b48d86a36083 Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 24 Sep 2013 15:28:58 +0100 Subject: [PATCH] bitset: Swap pthread_cond_broadcast for pthread_cond_signal Normally we'll only have one thread waiting anyway, but there's no point activating a race here in the cases where we have > 1 waiting, so signal is what we want. --- src/bitset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bitset.h b/src/bitset.h index a4b1ff8..2a3ef39 100644 --- a/src/bitset.h +++ b/src/bitset.h @@ -226,7 +226,7 @@ static inline void bitset_stream_enqueue( stream->in %= BITSET_STREAM_SIZE; pthread_mutex_unlock( & stream->mutex ); - pthread_cond_broadcast( &stream->cond_not_empty ); + pthread_cond_signal( &stream->cond_not_empty ); return; } @@ -259,7 +259,7 @@ static inline void bitset_stream_dequeue( stream->out %= BITSET_STREAM_SIZE; pthread_mutex_unlock( &stream->mutex ); - pthread_cond_broadcast( &stream->cond_not_full ); + pthread_cond_signal( &stream->cond_not_full ); return; }