Exemplo n.º 1
0
 private void commandSuspend(StringTokenizer t) throws NoSessionException {
   if (!t.hasMoreTokens()) {
     // Suspend all threads in the current thread group.
     // ### Issue: help message says default is all threads.
     // ### Behavior here agrees with 'jdb', however.
     ThreadIterator ti = currentThreadGroupThreads();
     while (ti.hasNext()) {
       // TODO - don't suspend debugger threads
       ti.nextThread().suspend();
     }
     env.notice("All (non-system) threads suspended.");
   } else {
     while (t.hasMoreTokens()) {
       ThreadReference thread = findThread(t.nextToken());
       if (thread != null) {
         // thread.suspend();
         runtime.suspendThread(thread);
       }
     }
   }
 }