static CloseableWrapper threadAsCloseable(Thread t) { ret t == null ?: new CloseableWrapper(t, -> cancelThread(t)); }