void () { if (myWatchedThreads.isEmpty()) return; VirtualMachineProxyImpl vmProxy = myProcess.getVirtualMachineProxy(); //TODO: can we do fast check without suspending all vmProxy.getVirtualMachine().suspend(); try { for (ThreadReferenceProxy thread : myWatchedThreads) { try { ObjectReference waitedMonitor = vmProxy.canGetCurrentContendedMonitor() ? thread.getThreadReference().currentContendedMonitor() : null; if (waitedMonitor != null && vmProxy.canGetMonitorInfo()) { ThreadReference blockingThread = waitedMonitor.owningThread(); if (blockingThread != null && blockingThread.suspendCount() > 1 && getCurrentThread() != blockingThread) { onThreadBlocked(thread.getThreadReference(), blockingThread, myProcess); } } } catch (ObjectCollectedException ignored) { } catch (IncompatibleThreadStateException e) { LOG.info(e); } catch (InternalException e) { if (e.errorCode() != JvmtiError.THREAD_NOT_ALIVE) { throw e; } } } } finally { DebuggerUtilsAsync.resume(vmProxy.getVirtualMachine()); } }