correction bug compartiment (init libre a true, et boucle while avec un ||, manquait aussi un notifyAll après avoir rempli un compartiment)

This commit is contained in:
trochas
2024-12-08 11:57:09 +01:00
parent 9f6dabf199
commit 13fe8abe71
5 changed files with 8 additions and 9 deletions

View File

@@ -31,16 +31,15 @@ public class Cuisinier extends Thread {
}
public void faire_cuire(Client client){
System.out.println("Cuisinier : fait cuire le plat de " + client.getNameClient()) ;
System.out.println("# Cuisinier : fait cuire le plat de " + client.getNameClient()) ;
try{
long temps_cuire =new Random().nextInt(300 - 100) + 100;
Thread.sleep(temps_cuire);
}catch(InterruptedException e){
e.printStackTrace();
}
System.out.println("Cuisinier : a fini de cuire le plat de " + client.getNameClient()) ;
System.out.println("# Cuisinier : a fini de cuire le plat de " + client.getNameClient()) ;
stand.nextClient();
stand.finir_cuit();
}
}