!7 p { Thread t = startThread("Whoopsie", r { while licensed { print("sleeping"); sleep(1000); print("done sleeping"); } }); assertEmpty(cancelledLiveThreads()); print("cancelling"); cancelThread(t); assertNempty(cancelledLiveThreads()); t = null; while licensed { gc(); L threads = cancelledLiveThreads(); print(threads); if (empty(threads)) break; threads = null; sleep(100); } assertEmpty(cancelledLiveThreads()); print("OK"); }