Beispiel #1
0
 // refer to Threads::get_pending_threads
 // Get list of Java threads that are waiting to enter the specified monitor.
 public List getPendingThreads(ObjectMonitor monitor) {
   List pendingThreads = new ArrayList();
   for (JavaThread thread = first(); thread != null; thread = thread.next()) {
     if (thread.isCompilerThread() || thread.isCodeCacheSweeperThread()) {
       continue;
     }
     ObjectMonitor pending = thread.getCurrentPendingMonitor();
     if (monitor.equals(pending)) {
       pendingThreads.add(thread);
     }
   }
   return pendingThreads;
 }