static Set isThreadRunnable_x_exclude = lithashset( "sun.nio.fs.WindowsNativeDispatcher.GetQueuedCompletionStatus0", "Java.lang.Thread.start0", "java.lang.Object.wait", "java.net.Inet6AddressImpl.lookupAllHostAddr", "java.io.FileInputStream.readBytes", // This usually means blocking "jdk.internal.misc.Unsafe.park", "sun.misc.Unsafe.park", "java.net.SocketInputStream.socketRead0", "java.net.PlainSocketImpl.socketConnect", "java.net.PlainSocketImpl.socketAccept", "sun.awt.X11.XToolkit.waitForEvents", "java.net.DualStackPlainSocketImpl.accept0", "org.jnativehook.GlobalScreen$NativeHookThread.enable", "java.lang.Thread.sleep", "sun.nio.ch.EPollArrayWrapper.epollWait", "com.ibm.lang.management.internal.MemoryNotificationThread.processNotificationLoop", "com.ibm.tools.attach.target.IPC.waitSemaphore", "sun.nio.ch.Net.poll", "sun.nio.ch.Net.accept", "sun.nio.ch.Net.connect0", "sun.nio.ch.EPoll.wait", "sun.nio.ch.SocketDispatcher.read0", "sun.nio.fs.LinuxWatchService.poll", "java.lang.ref.Reference.waitForReferencePendingList", "com.sun.java.accessibility.internal.AccessBridge.runDLL", "java.lang.ProcessHandleImpl.waitForProcessExit0"); sbool isThreadRunnable_x(StackTraceElement[] trace) { StackTraceElement e = first(trace); if (e == null) false; // Weird threads like "DestroyJavaVM" S s = e.getClassName() + "." + e.getMethodName(); ret !isThreadRunnable_x_exclude.contains(s); } sbool isThreadRunnable_x(Thread t, StackTraceElement[] trace) { try object (Bool) vmBus_query isThreadRunnable_x(t, trace); if (t.getState() != Thread.State.RUNNABLE) false; ret isThreadRunnable_x(trace); }