maj constructeur restaurant

This commit is contained in:
trochas
2024-12-02 16:05:16 +01:00
parent f9bcb77443
commit 2e59ca9239

View File

@@ -8,6 +8,17 @@ public class Client extends Thread {
this.restaurant=restaurant;
}
public void run(){
while(!this.restaurant.libre()){
try {
wait();
} catch (Exception e) {
System.out.println("Mi piace tagliare gli spaghetti ! Mi piace la pizza all'ananas ! \n" + e);
}
}
}
public void prendre_portion(Compartiment compartiment){
synchronized(compartiment){
int r =new Random().nextInt(MAX_PORTION);