This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
PF3/hw1/Ex2/src/semaphore/Queue.java

21 lines
603 B
Java

package semaphore;
public interface Queue<T> {
/**
* Puts an element into the queue, waiting if necessary for
* space to become available
* @param the element to be put into the queue
* @throws InterruptedException if interrupted while waiting
*/
void put (T element) throws InterruptedException;
/**
* Retrieves and removes the first element in this queue (in FIFO order),
* waiting if necessary until a element enters the queue
* @return the first element on this queue
* @throws InterruptedException if interrupted while waiting
*/
T take() throws InterruptedException;
}