Skip to content

Commit

Permalink
8310551: vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java …
Browse files Browse the repository at this point in the history
…timed out due to missing prompt

Reviewed-by: sspitsyn
Backport-of: c84866a
  • Loading branch information
plummercj committed Jul 19, 2023
1 parent 6d9da7c commit fde53fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,3 @@ vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java
vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEarlyReturn001.java 7199837 generic-all

vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Multi/Multi005/TestDescription.java 8076494 windows-x64

vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java 8310551 linux-all
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -89,7 +89,7 @@ public static int run(String argv[], PrintStream out) {
static final String LAST_BREAK = DEBUGGEE_CLASS + ".breakHere";
static final String MYTHREAD = "MyThread";
static final String DEBUGGEE_THREAD = DEBUGGEE_CLASS + "$" + MYTHREAD;
static final String DEBUGGEE_RESULT = DEBUGGEE_CLASS + ".notInterrupted.get()";
static final String DEBUGGEE_RESULT = DEBUGGEE_CLASS + ".notInterrupted";

static int numThreads = nsk.jdb.interrupt.interrupt001.interrupt001a.numThreads;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -56,8 +56,8 @@ public void run() {
lock.wait();
}
} catch (InterruptedException e) {
notInterrupted.decrementAndGet();
synchronized (waitnotify) {
notInterrupted--;
waitnotify.notify();
}
}
Expand All @@ -83,7 +83,7 @@ static void breakHere () {}
private JdbArgumentHandler argumentHandler;
private Log log;

public static final AtomicInteger notInterrupted = new AtomicInteger(numThreads);
public static volatile int notInterrupted = numThreads;

public int runIt(String args[], PrintStream out) {

Expand Down Expand Up @@ -122,8 +122,8 @@ public int runIt(String args[], PrintStream out) {

long waitTime = argumentHandler.getWaitTime() * 60 * 1000;
long startTime = System.currentTimeMillis();
while (notInterrupted.get() > 0 && System.currentTimeMillis() - startTime <= waitTime) {
synchronized (waitnotify) {
synchronized (waitnotify) {
while (notInterrupted > 0 && System.currentTimeMillis() - startTime <= waitTime) {
try {
waitnotify.wait(waitTime);
} catch (InterruptedException e) {
Expand Down

0 comments on commit fde53fc

Please sign in to comment.