Skip to content

Commit

Permalink
8288532: additional review changes for JDK-8286830
Browse files Browse the repository at this point in the history
Reviewed-by: pchilanomate, dholmes
  • Loading branch information
Daniel D. Daugherty committed Jun 21, 2022
1 parent a144988 commit 31d981e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/hotspot/share/runtime/thread.inline.hpp
Expand Up @@ -147,6 +147,12 @@ class AsyncExceptionHandshake : public AsyncHandshakeClosure {
}

~AsyncExceptionHandshake() {
Thread* current = Thread::current();
// Can get here from the VMThread via install_async_exception() bail out.
if (current->is_Java_thread()) {
guarantee(JavaThread::cast(current)->is_oop_safe(),
"JavaThread cannot touch oops after its GC barrier is detached.");
}
assert(!_exception.is_empty(), "invariant");
_exception.release(Universe::vm_global());
}
Expand Down
4 changes: 3 additions & 1 deletion test/hotspot/jtreg/runtime/Thread/StopAtExit.java
Expand Up @@ -23,7 +23,7 @@

/**
* @test
* @bug 8167108 8266130 8283467 8284632
* @bug 8167108 8266130 8283467 8284632 8286830
* @summary Stress test JVM/TI StopThread() at thread exit.
* @requires vm.jvmti
* @run main/othervm/native -agentlib:StopAtExit StopAtExit
Expand Down Expand Up @@ -72,6 +72,8 @@ public static void main(String[] args) {
usage();
}
}
timeMax /= 2; // Split time between the two sub-tests.

test(timeMax);

// Fire-up deamon that just creates new threads. This generates contention on
Expand Down
6 changes: 4 additions & 2 deletions test/hotspot/jtreg/runtime/Thread/SuspendAtExit.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, 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 All @@ -23,7 +23,7 @@

/**
* @test
* @bug 8167108 8265240
* @bug 8167108 8265240 8286830
* @summary Stress test SuspendThread at thread exit.
* @requires vm.jvmti
* @run main/othervm/native -agentlib:SuspendAtExit SuspendAtExit
Expand Down Expand Up @@ -78,6 +78,8 @@ public static void main(String[] args) {
usage();
}
}
timeMax /= 2; // Split time between the two sub-tests.

test(timeMax);

// Fire-up deamon that just creates new threads. This generates contention on
Expand Down

0 comments on commit 31d981e

Please sign in to comment.