ok
This commit is contained in:
@@ -7,6 +7,15 @@ public class Cuisinier extends Thread {
|
|||||||
this.stand= stand_de_cuisson;
|
this.stand= stand_de_cuisson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void run(){
|
||||||
|
while(true){
|
||||||
|
Client client= stand.attendClient();
|
||||||
|
if(client!= null){
|
||||||
|
faire_cuire(client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void faire_cuire(Client client){
|
public void faire_cuire(Client client){
|
||||||
try{
|
try{
|
||||||
long temps_cuire =new Random().nextInt(300 - 100) + 100;
|
long temps_cuire =new Random().nextInt(300 - 100) + 100;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
public class Stand_de_cuisson {
|
public class Stand_de_cuisson {
|
||||||
public synchronized void finir_cuit(){
|
public synchronized void attendClient(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public synchronized void finir_cuit(Client client){
|
||||||
|
notifyAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user