KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have two threads. Thread A is pulling some elements from queue and thread B is adding some elements to the queue. I want thread A to go to sleep when the queue is empty. When thread B adds some element to the queue it should make sure that thread A is working. How can this be done in Java?
Tags (comma-separated)
Save Edits
Cancel