You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
539 B
21 lines
539 B
import sweet.*;
|
|
import world.ThreadWeaver;
|
|
|
|
public class Main3A {
|
|
public static void main(String[] args) {
|
|
ThreadWeaver tw = new ThreadWeaver();
|
|
Boulangerie b = new BoulangerieThreadSafe();
|
|
Patissier p = new Patissier(b);
|
|
tw.addRunners(p, new LimitedClient(b));
|
|
tw.weave();
|
|
tw.run();
|
|
|
|
try{
|
|
Thread.sleep(2000);
|
|
} catch (InterruptedException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
p.shouldRun.set(false);
|
|
tw.recover();
|
|
}
|
|
} |