// a variant of thread where you can get the Runnable target later. // Also notes its existence on the VM bus. // We should use this exclusively instead of Thread. sclass BetterThread extends Thread { Runnable target; *(Runnable *target) { _created(); } *(Runnable *target, S name) { super(name); _created(); } void _created() { vmBus_send threadCreated(this); } run { try { vmBus_send threadStarted(this); if (target != null) target.run(); } finally { vmBus_send threadEnded(this); } } Runnable getTarget() { ret target; } }