Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class A {
- static B b;
- static class B {
- int x;
- B(int x) {
- this.x = x;
- }
- }
- public static void main(String[] args) {
- new Thread() {
- void f(B q) {
- if (q.x != 1) {
- System.out.println(q.x);
- System.exit(1);
- }
- }
- @Override
- public void run() {
- while (b == null);
- while (true) f(b);
- }
- }.start();
- for (int x = 0;;x++)
- b = new B(Math.max(x%2,1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement