test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004a.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.
   125                                      pipe.println("waitnotifyerr");
   125                                      pipe.println("waitnotifyerr");
   126                                  }
   126                                  }
   127                              }
   127                              }
   128                          }
   128                          }
   129                          log1("mainThread is out of: synchronized (lockingObject)");
   129                          log1("mainThread is out of: synchronized (lockingObject)");
   130 
   130                          while (true) {
   131                          instruction = pipe.readln();
   131                              instruction = pipe.readln();
   132                          if (!instruction.equals("check_alive")) {
   132                              if (instruction.equals("check_done")) {
   133                              logErr("ERROR: unexpected instruction: " + instruction);
   133                                  if (test_thread.isAlive()) {
   134                              exitCode = FAILED;
   134                                      logErr("thread thread2 is still alive");
   135                          } else {
   135                                      exitCode = FAILED;
   136                              log1("checking on: thread2.isAlive");
   136                                  }
   137                              if (test_thread.isAlive()) {
   137                                  break;
   138                                  test_thread.resume();
   138                              } else if (instruction.equals("check_alive")) {
   139                                  pipe.println("alive");
   139                                  log1("checking on: thread2.isAlive");
       
   140                                  if (test_thread.isAlive()) {
       
   141                                      test_thread.resume();
       
   142                                      pipe.println("alive");
       
   143                                  } else {
       
   144                                      pipe.println("not_alive");
       
   145                                  }
   140                              } else {
   146                              } else {
   141                                  pipe.println("not_alive");
   147                                  logErr("ERROR: unexpected instruction: " + instruction);
       
   148                                  exitCode = FAILED;
       
   149                                  break;
   142                              }
   150                              }
   143                          }
   151                          }
   144 
   152 
   145                          break ;
   153                          break ;
   146 
   154