correction du stand de cuissant et cuisinier

This commit is contained in:
Rochas
2024-12-07 12:37:03 +01:00
parent ce6a25f578
commit 3624e1ab66
9 changed files with 90 additions and 19 deletions

View File

@@ -10,8 +10,7 @@ public class Cuisinier extends Thread {
public void run(){
while(Thread.currentThread().isDaemon()){
//while(true){
Client client= stand.attendClient();
Client client= stand.getClient();
if(client!= null){
faire_cuire(client);
}
@@ -19,14 +18,17 @@ public class Cuisinier extends Thread {
}
public void faire_cuire(Client client){
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);
//long temps_cuire =new Random().nextInt(300 - 100) + 100;
//Thread.sleep(temps_cuire);
Thread.sleep(3000);
}catch(InterruptedException e){
e.printStackTrace();
}
System.out.println("Cuisinier : a fini de cuire le plat de " + client.getNameClient()) ;
stand.nextClient();
stand.finir_cuit(client);
stand.notifyAll();
}
}