sbool interruptThread_verbose; svoid interruptThread(Thread t) { if (t == null) ret; if (interruptThread_verbose) print("Interrupting thread " + t); // note reason in global map vm_threadInterruptionReasonsMap().put(t, getStackTrace()); t.interrupt(); URLConnection c = cast vm_generalSubMap("URLConnection per thread").get(t); if (c != null) pcall { print("Closing URLConnection of interrupted thread."); call(c, 'disconnect); } }