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