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