Extends Queue, FIFO structure.
Implemented by ArrayBlockingQueue and LinkedBlockingQueue.
Allows any operations to wait until it can be successfully executed. E.g. removing from a queue will be executed until the queue will not be empty.
Due to the above statement, BlockingQueue is thread-safe.
Waiting/blocking means the execution of that thread will be halted until condition is met.
There is no direct implementation, use it through its implementing classes.
EXAMPLE FOR BLOCKINGQUEUE:
The constructors has 2 signatures:
no argument: the queue is infinite
integer argument: size of the queue
The offer() and poll() methods have 2 signatures.
EXAMPLE FOR OFFER() AND POLL() SIGNATURES:
The next methods can block the execution by themselves.
EXAMPLE FOR BLOCKED EXECUTION: