This commit is contained in:
Minh VU
2024-11-28 10:59:06 +01:00
parent d3f78c7ec1
commit d73649f77f
3 changed files with 28 additions and 7 deletions

View File

@@ -2,15 +2,12 @@ import java.util.Random;
public class Client extends Thread {
private int MAX_PORTION = 100;
protected Compartiment compartiment;
protected Restaurant restaurant;
public Client (Compartiment c, Restaurant restaurant){
this.compartiment=c;
public Client (Restaurant restaurant){
this.restaurant=restaurant;
}
public void prendre_portion(Compartiment compartiment){
synchronized(compartiment){
int r =new Random().nextInt(MAX_PORTION);
@@ -59,4 +56,8 @@ public class Client extends Thread {
restaurant.diminuerClient();
restaurant.notifyAll();
}
public void cuir_au_stand(Stand_de_cuisson stand){
//stand.
}
}