Exemplo n.º 1
0
 // Get list of Java threads that have called Object.wait on the specified monitor.
 public List getWaitingThreads(ObjectMonitor monitor) {
   List pendingThreads = new ArrayList();
   for (JavaThread thread = first(); thread != null; thread = thread.next()) {
     ObjectMonitor waiting = thread.getCurrentWaitingMonitor();
     if (monitor.equals(waiting)) {
       pendingThreads.add(thread);
     }
   }
   return pendingThreads;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
 public JavaThread owningThreadFromMonitor(ObjectMonitor monitor) {
   return owningThreadFromMonitor(monitor.owner());
 }