Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dream;
- import sleep.Sleeper;
- public class Dream {
- public void dream(final Sleeper s) {
- Thread thread = new Thread(new Runnable() {
- public void run() {
- s.enter(new Dream() {
- @Override
- public void dream(Sleeper s) {
- try {
- s.wait(500);
- } catch (InterruptedException e) {
- }
- }
- });
- }
- });
- thread.start();
- try {
- s.wait(100);
- } catch (InterruptedException e) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement