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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user