sclass _Activity { long started; O r; Thread thread; } static Set<_Activity> tempActivity_list = synchroHashSet(); sbool tempActivity_debug; static AutoCloseable tempActivity(fO r) { if (tempActivity_debug) print("Activity started: " + r); final new _Activity a; a.started = sysNow(); a.r = r; a.thread = currentThread(); tempActivity_list.add(a); ret new AutoCloseable { public void close() { tempActivity_list.remove(a); if (tempActivity_debug) { int n = l(tempActivity_list); print("Activity ended: " + r + (n == 0 ? "" : " - " + n + " remaining")); } } }; }