Files
tp-4-wok/src/Stand_de_cuisson.java
Minh VU 05d1859f81 test
2024-12-02 15:52:43 +01:00

24 lines
587 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();
}
public synchronized void ajouter_client(Client client){
clients.add(client);
}
}