8203948: Expand JVMTI callback notion of "internal threads"
authorkbarrett
Mon, 04 Jun 2018 20:14:13 -0400
changeset 50392 625f9432612a
parent 50391 2bea53d7a27b
child 50393 5488cccb6bbd
8203948: Expand JVMTI callback notion of "internal threads" Summary: Allow any NamedThreads in some contexts. Reviewed-by: coleenp, dholmes
src/hotspot/share/prims/jvmtiEnter.xsl
src/hotspot/share/prims/jvmtiEnv.cpp
--- a/src/hotspot/share/prims/jvmtiEnter.xsl	Mon Jun 04 16:21:08 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiEnter.xsl	Mon Jun 04 20:14:13 2018 -0400
@@ -1,6 +1,6 @@
 <?xml version="1.0"?> 
 <!--
- Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2018, 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
@@ -571,7 +571,7 @@
     transition = false;
   } else {
     this_thread = Thread::current_or_null();
-    transition = ((this_thread != NULL) &amp;&amp; !this_thread->is_VM_thread() &amp;&amp; !this_thread->is_ConcurrentGC_thread());
+    transition = ((this_thread != NULL) &amp;&amp; !this_thread->is_Named_thread());
   }
   if (transition) {</xsl:text>
 	</xsl:otherwise>
--- a/src/hotspot/share/prims/jvmtiEnv.cpp	Mon Jun 04 16:21:08 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp	Mon Jun 04 20:14:13 2018 -0400
@@ -3313,7 +3313,7 @@
 #endif /* PROPER_TRANSITIONS */
       assert(r == ObjectMonitor::OM_OK, "raw_enter should have worked");
     } else {
-      if (thread->is_VM_thread() || thread->is_ConcurrentGC_thread()) {
+      if (thread->is_Named_thread()) {
         r = rmonitor->raw_enter(thread);
       } else {
         ShouldNotReachHere();
@@ -3351,7 +3351,7 @@
 #endif /* PROPER_TRANSITIONS */
       r = rmonitor->raw_exit(current_thread);
     } else {
-      if (thread->is_VM_thread() || thread->is_ConcurrentGC_thread()) {
+      if (thread->is_Named_thread()) {
         r = rmonitor->raw_exit(thread);
       } else {
         ShouldNotReachHere();
@@ -3408,7 +3408,7 @@
 
 #endif /* PROPER_TRANSITIONS */
   } else {
-    if (thread->is_VM_thread() || thread->is_ConcurrentGC_thread()) {
+    if (thread->is_Named_thread()) {
       r = rmonitor->raw_wait(millis, true, thread);
     } else {
       ShouldNotReachHere();
@@ -3442,7 +3442,7 @@
     ThreadInVMfromUnknown __tiv;
     r = rmonitor->raw_notify(current_thread);
   } else {
-    if (thread->is_VM_thread() || thread->is_ConcurrentGC_thread()) {
+    if (thread->is_Named_thread()) {
       r = rmonitor->raw_notify(thread);
     } else {
       ShouldNotReachHere();
@@ -3472,7 +3472,7 @@
     ThreadInVMfromUnknown __tiv;
     r = rmonitor->raw_notifyAll(current_thread);
   } else {
-    if (thread->is_VM_thread() || thread->is_ConcurrentGC_thread()) {
+    if (thread->is_Named_thread()) {
       r = rmonitor->raw_notifyAll(thread);
     } else {
       ShouldNotReachHere();