JDK-8305936 : JavaThread::create_system_thread_object has unused is_visible argument
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-04-12
  • Updated: 2023-04-20
  • Resolved: 2023-04-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b19Fixed
Related Reports
Relates :  
Description
JavaThread::create_system_thread_object has an is_visible argument, which is supposed to control whether the thread is visible to external suspension.

However, JDK-8284161 eliminated the use of that argument.

The functionality of whether the thread is externally visible is provided by the virtual function Thread::is_hidden_from_external_view().
Comments
Changeset: 8a1639d4 Author: David Holmes <dholmes@openjdk.org> Date: 2023-04-13 23:10:18 +0000 URL: https://git.openjdk.org/jdk/commit/8a1639d49b4adc45501fe77cedfef3ca5f42c7f5
13-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13455 Date: 2023-04-13 05:41:31 +0000
13-04-2023

[~kbarrett] I was just about to add this comment ... Before Loom, Threads were explicitly added to their ThreadGroup, first as an unstarted thread during Thread construction, and then as a live thread once the thread was started. For system threads we would call tg.add(t) depending on whether the thread needed to be visible or not (adding makes it visible). After Loom, ThreadGroups no longer track the threads that are in them, instead the Java logic calls into the VM to getAllThreads() and then filters based on groups. The VM code uses the ThreadsListEnumerator with all false arguments, to get the set of live threads. Whether or not a system thread is returned depends on the result of jt->is_hidden_from_external_view(). The method is overloaded to return true for the following threads: - compiler threads - serviceThread - monitorDeflationThread This is the same set of threads which set is_visible to false when calling create_system_thread_object.
13-04-2023