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.

24 lines
580 B

import sweet.Boulangerie;
import sweet.Client;
import sweet.Patissier;
import world.ThreadWeaver;
public class Main {
public static void main(String[] args) {
ThreadWeaver tw = new ThreadWeaver();
Boulangerie b = new Boulangerie();
Patissier p = new Patissier(b);
tw.addRunners(p, new Client(b));
tw.weave();
tw.run();
try{
Thread.sleep(2000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
p.shouldRun.set(false);
tw.recover(100L);
}
}