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