no bug
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Restaurant {
|
public class Restaurant {
|
||||||
protected final int MAX_CLIENTS = 25;
|
protected final int MAX_CLIENTS = 25;
|
||||||
private int nbClient;
|
private int nbClient;
|
||||||
|
|
||||||
|
private ArrayList<Client> clients_stand = new ArrayList<Client>();
|
||||||
|
|
||||||
private Compartiment[] buffet = new Compartiment[4];
|
private Compartiment[] buffet = new Compartiment[4];
|
||||||
private Employe_du_buffet employeB;
|
private Employe_du_buffet employeB;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
public class Stand_de_cuisson {
|
import java.util.LinkedList;
|
||||||
public synchronized void attendClient(){
|
import java.util.Queue;
|
||||||
|
|
||||||
|
public class Stand_de_cuisson {
|
||||||
|
private Queue<Client> clients = new LinkedList<Client>();
|
||||||
|
public synchronized Client attendClient(){
|
||||||
|
while(clients.isEmpty()){
|
||||||
|
try{
|
||||||
|
wait();
|
||||||
|
}catch (Exception e) {
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clients.poll();
|
||||||
}
|
}
|
||||||
public synchronized void finir_cuit(Client client){
|
public synchronized void finir_cuit(Client client){
|
||||||
notifyAll();
|
notifyAll();
|
||||||
|
|||||||
Reference in New Issue
Block a user