title: How to resume my thread that is in a blocking process due to linkedBlockingQueue.take()
body: <p>I have a producer thread which will keep inserting values into a linkedBlockingQueue and have multiple consumer thread that will take() from this linkedBlockingQueue concurrently. My condition for them to keep thinking is when my flag for producer has finished is false and they will stop trying to take when it is true. however i met with the issue whereby my second thread is in the take() block process. I believe it is because before my producer set the flag to true when it ends, one of the tread is already inside the run() body executing the take() blocking method. As there wont be any new element added into linkedBlockingQueue, it will be in a forever blocking processs. How can i rectify this issue?</p>