!7 p-exp { Thread thread = startThread(r { while (true) { busySleepSeconds_noPing(1); ping(); } }); thread { sleep(random(3000)); printWithMS("Cancelling thread"); cancelThreadAndWait(thread); printWithMS("Cancelled thread"); } repeat 20 { print("State: " + thread.getState()); sleepSeconds(1/3.0); } }