The BlockingQueue interface is part of the java.util.concurrent package.
If a producer thread tries to put an element in a full BlockingQueue, it gets blocked and stays blocked until a consumer removes an element.
Similarly, if a consumer thread tries to take an element from an empty BlockingQueue, it gets blocked and remains blocked until a producer adds an element.
https://www.geeksforgeeks.org/producer-consumer-solution-using-blockingqueue-in-java-thread/