20 lines
491 B
Java
20 lines
491 B
Java
import java.util.LinkedList;
|
|
import java.util.Queue;
|
|
|
|
public class Stand_de_cuisson {
|
|
private Queue<Client> clients = new LinkedList<Client>();
|
|
public synchronized Client attendClient(){
|
|
while(clients.isEmpty()){
|
|
try{
|
|
wait();
|
|
}catch (Exception e) {
|
|
System.out.println(e);
|
|
}
|
|
}
|
|
return clients.poll();
|
|
}
|
|
public synchronized void finir_cuit(Client client){
|
|
notifyAll();
|
|
}
|
|
}
|