single element write can only really wakeup a single thread

Fixes #6800
This commit is contained in:
Colin Surprenant 2017-03-10 11:20:27 -08:00 committed by Suyog Rao
parent 32777c682b
commit 6ac0b6a848

View file

@ -330,7 +330,9 @@ public class Queue implements Closeable {
this.unreadCount++;
// if the queue was empty before write, signal non emptiness
if (wasEmpty) { notEmpty.signalAll(); }
// a simple signal and not signalAll is necessary here since writing a single element
// can only really enable a single thread to read a batch
if (wasEmpty) { notEmpty.signal(); }
// now check if we reached a queue full state and block here until it is not full
// for the next write or the queue was closed.