correction de bug, normalement tout marche + rapport

This commit is contained in:
Rochas
2024-12-07 16:46:49 +01:00
parent f5cb2d1582
commit 9f6dabf199
7 changed files with 77 additions and 68 deletions

View File

@@ -4,19 +4,6 @@ import java.util.Queue;
public class Stand_de_cuisson {
private Queue<Client> clients = new LinkedList<Client>();
/*
* retourne le client qui est en tête de queue et le supprime de la queue
*/
public synchronized Client getNextClient2(){
while(clients.isEmpty()){
try{
wait();
}catch (InterruptedException e) {
e.printStackTrace();
}
}
return clients.poll();
}
//get le client en tête de queue
public synchronized Client getClient(){
@@ -28,13 +15,13 @@ public class Stand_de_cuisson {
clients.poll();
}
public synchronized void finir_cuit(Client client){
public synchronized void finir_cuit(){
notifyAll();
}
public synchronized void ajouter_client(Client client){
clients.add(client);
notify();
notifyAll();
}
public synchronized boolean containsClient(Client client){