!7 p { Thread t = startThread("Whoopsie", r { while licensed { print("sleeping"); sleep(1000); print("done sleeping"); } }); assertEmpty(cancelledThreads()); print("cancelling"); cancelThread(t); t = null; repeat 20 { gc(); print(cancelledThreads()); sleep(100); } assertEmpty(cancelledThreads()); print("OK"); }