scope newPing_addToStack asclass #StackEntry implements Runnable { Runnable previous; *(Runnable *previous) {} abstract void impl {} run { callF(previous); } } static AutoCloseable newPing_addToStack(Thread thread default currentThread(), Runnable r) { if (r == null) null; ThreadLocal tl = newPing_actionTL(); var old = tl.get(); tl.set(new StackEntry(old) { void impl { r.run(); } }); ret () -> { tl.set(old); } } end scope