sclass DoubleVar { double a; // you can access this directly if you use one thread *() {} *(double *a) {} public synchronized void set(double v) { if (v != a) { a = v; notifyAll(); } } public synchronized double get() { ret a; } synchronized double waitForValue(double x) ctex { while (a != x) wait(); ret a; } toString { ret str(this!); } }