sclass PingSource { // returns true if it slept settable volatile IF0 action; // returns true if it slept final bool get() { var a = action; ret a != null && a!; } void cancel { action = new Cancelled; } sclass Cancelled is IF0 { public Bool get() { throw new PingSourceCancelledException(this); } } }