diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index f14ddd67043..c05c2b2e7c9 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -171,5 +171,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 diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java index a2d46e4ac15..73f251b71e9 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001.java @@ -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 @@ -89,7 +89,7 @@ public class interrupt001 extends JdbTest { 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; diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001a.java index 973ee4974cd..25016ce0f37 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/interrupt/interrupt001/interrupt001a.java @@ -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 @@ -56,8 +56,8 @@ public class interrupt001a { lock.wait(); } } catch (InterruptedException e) { - notInterrupted.decrementAndGet(); synchronized (waitnotify) { + notInterrupted--; waitnotify.notify(); } } @@ -83,7 +83,7 @@ public class interrupt001a { 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) { @@ -122,8 +122,8 @@ public class interrupt001a { 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) {