test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001.java
changeset 54012 6684c75ab531
parent 53869 34906de6c017
equal deleted inserted replaced
54011:21ea4076a275 54012:6684c75ab531
    40  *                                                              <BR>
    40  *                                                              <BR>
    41  * The test checks up that results of the method                <BR>
    41  * The test checks up that results of the method                <BR>
    42  * <code>com.sun.jdi.VirtualMachine.allThreads()</code>         <BR>
    42  * <code>com.sun.jdi.VirtualMachine.allThreads()</code>         <BR>
    43  * complies with the its spec.                                  <BR>
    43  * complies with the its spec.                                  <BR>
    44  * <BR>
    44  * <BR>
    45  * The test checks up the reasults of the method when           <BR>
    45  * The test checks up the results of the method when            <BR>
    46  * it is invoked two times in raw immediately after             <BR>
    46  * it is invoked two times in raw immediately after             <BR>
    47  * new thread has been started in the debuggee VM.              <BR>
    47  * new thread has been started in the debuggee VM.              <BR>
    48  *                                                              <BR>
    48  *                                                              <BR>
    49  * After being started up,                                              <BR>
    49  * After being started up,                                              <BR>
    50  * a debuggee creates a 'lockingObject' for synchronizing threads,      <BR>
    50  * a debuggee creates a 'lockingObject' for synchronizing threads,      <BR>
   190 
   190 
   191             int expresult = returnCode0;
   191             int expresult = returnCode0;
   192 
   192 
   193             String threadName = "testedThread";
   193             String threadName = "testedThread";
   194 
   194 
       
   195             // Suspend VM to ensure no new background thread (e.g. JVMCI
       
   196             // compiler thread) is started between two allThreads() calls.
       
   197             vm.suspend();
   195             List allThreads1 = vm.allThreads();
   198             List allThreads1 = vm.allThreads();
   196             log2("allThreads1.size() = " + allThreads1.size());
   199             log2("allThreads1.size() = " + allThreads1.size());
   197 
   200 
   198             List allThreads2 = vm.allThreads();
   201             List allThreads2 = vm.allThreads();
   199             log2("allThreads2.size() = " + allThreads2.size());
   202             log2("allThreads2.size() = " + allThreads2.size());
       
   203             vm.resume();
   200 
   204 
   201             if ( allThreads1.size() != allThreads2.size() ) {
   205             if ( allThreads1.size() != allThreads2.size() ) {
   202                 log3("ERROR:  allThreads1.size() != allThreads2.size()");
   206                 log3("ERROR:  allThreads1.size() != allThreads2.size()");
   203                 expresult = returnCode1;
   207                 expresult = returnCode1;
   204             }
   208             }