コード例 #1
0
ファイル: Threads.java プロジェクト: netroby/jdk9-dev
 // 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;
 }
コード例 #2
0
ファイル: Threads.java プロジェクト: netroby/jdk9-dev
 // 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;
 }
コード例 #3
0
ファイル: Threads.java プロジェクト: netroby/jdk9-dev
 public JavaThread owningThreadFromMonitor(ObjectMonitor monitor) {
   return owningThreadFromMonitor(monitor.owner());
 }