Does add() on LinkedBlockingQueue notify waiting threads?
- by obvio171
I have a consumer thread taking elements from a LinkedBlockingQueue, and I make it sleep manually when it's empty. I use peek() to see if the queue empty because I have to do stuff because sending the thread to sleep, and I do that with queue.wait().
So, when I'm in another thread and add()an element to the queue, does that automatically notify the thread that was wait()ing on the queue?