sclass _Activity { long started; O r; Thread thread; } static Set tempActivity_list = synchroHashSet(); static AutoCloseable tempActivity(O r) { 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); } }; }