svoid cancelForeignThread(Thread t) { if (t == null) ret; O mc = getMainClassForThread(t); if (mc == null) ret with print("Can't find main class for thread " + t); ping(); Map ping_actions = cast get(mc, 'ping_actions); if (ping_actions == null) ret with print("No ping_actions"); synchronized(ping_actions) { ping_actions.put(t, "cancelled"); set(mc, ping_anyActions := true); print("Cancelled foreign thread: " + t); } } svoid cancelForeignThread(long threadID) { cancelForeignThread(getThreadByID(threadID)); }