srecord noeq FastCollabWorker(FastCollab collab, int workerIndex) extends Thread { volatile gettable long errorCount; volatile gettable long spinWaits; volatile gettable long workCount; volatile gettable Throwable lastError; settable PingSource interruptor; run { Runnable work; var interruptor = this.interruptor; while ((work = collab.grabWork(workerIndex)) != collab.DONE) { interruptor?.ping(); try { if (work != null) { ++workCount; work.run(); } else ++spinWaits; } catch e { ++errorCount; lastError = e; } } } }