test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003a.java
changeset 53960 6c3fd94de35a
parent 50018 3ba0d8631f24
equal deleted inserted replaced
53959:1542e63eb537 53960:6c3fd94de35a
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   124                                  }
   124                                  }
   125                              }
   125                              }
   126                          }
   126                          }
   127                          log1("mainThread is out of: synchronized (lockingObject)");
   127                          log1("mainThread is out of: synchronized (lockingObject)");
   128 
   128 
   129                          instruction = pipe.readln();
   129                          while (true) {
   130                          if (!instruction.equals("check_alive")) {
   130                              instruction = pipe.readln();
   131                              logErr("ERROR: unexpected instruction: " + instruction);
   131                              if (instruction.equals("check_done")) {
   132                              exitCode = FAILED;
   132                                  if (test_thread.isAlive()) {
   133                          } else {
   133                                      logErr("ERROR: thread2 thread is still alive");
   134                              log1("checking on: thread2.isAlive");
   134                                      exitCode = FAILED;
   135                              if (test_thread.isAlive()) {
   135                                  }
   136                                  test_thread.resume();
   136                                  break;
   137                                  pipe.println("alive");
   137                              } else if (instruction.equals("check_alive")) {
       
   138                                  log1("checking on: thread2.isAlive");
       
   139                                  if (test_thread.isAlive()) {
       
   140                                      test_thread.resume();
       
   141                                      pipe.println("alive");
       
   142                                  } else {
       
   143                                      pipe.println("not_alive");
       
   144                                  }
   138                              } else {
   145                              } else {
   139                                  pipe.println("not_alive");
   146                                  logErr("ERROR: unexpected instruction: " + instruction);
       
   147                                  exitCode = FAILED;
       
   148                                  break;
   140                              }
   149                              }
   141                          }
   150                          }
   142 
   151 
   143                          break ;
   152                          break ;
   144 
   153