This commit is contained in:
Minh VU
2024-12-02 15:43:46 +01:00
parent a828ee8170
commit 99198760bb
2 changed files with 18 additions and 3 deletions

View File

@@ -1,6 +1,17 @@
public class Stand_de_cuisson {
public synchronized void attendClient(){
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();