Skip to content

[JDK-8354113] Adapt JDK-8351927: Change VirtualThread implementation to use use FJP delayed task handling #11013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+17-1898", "platformspecific": true, "extrabundles": ["static-libs"]},
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+18-2095", "platformspecific": true, "extrabundles": ["static-libs"]},

"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ public final class Target_java_lang_VirtualThread {
@TargetElement(onlyWith = JDK21OrEarlier.class) //
private static ScheduledExecutorService UNPARKER;

@Alias //
@InjectAccessors(DelayedTaskSchedulersAccessor.class) //
@TargetElement(onlyWith = JDKLatest.class) //
private static ScheduledExecutorService[] DELAYED_TASK_SCHEDULERS;

/** Go through {@link #nondefaultScheduler}. */
@Alias //
@InjectAccessors(SchedulerAccessor.class) //
Expand Down Expand Up @@ -134,10 +129,6 @@ public final class Target_java_lang_VirtualThread {
@TargetElement(onlyWith = JDK21OrEarlier.class)
private static native ScheduledExecutorService createDelayedTaskScheduler();

@Alias
@TargetElement(onlyWith = JDKLatest.class)
private static native ScheduledExecutorService[] createDelayedTaskSchedulers();

@SuppressWarnings("unused")
private static final class AlwaysFalseAccessor {
static boolean get(Target_java_lang_VirtualThread vt) {
Expand Down Expand Up @@ -192,28 +183,6 @@ private static synchronized ScheduledExecutorService initializeDelayedTaskSchedu
}
}

private static final class DelayedTaskSchedulersAccessor {
private static volatile ScheduledExecutorService[] delayedTaskSchedulers;

@SuppressWarnings("unused")
public static ScheduledExecutorService[] get() {
ScheduledExecutorService[] result = delayedTaskSchedulers;
if (result == null) {
result = initializeDelayedTaskScheduler();
}
return result;
}

private static synchronized ScheduledExecutorService[] initializeDelayedTaskScheduler() {
ScheduledExecutorService[] result = delayedTaskSchedulers;
if (result == null) {
result = createDelayedTaskSchedulers();
delayedTaskSchedulers = result;
}
return result;
}
}

@SuppressWarnings("unused")
private static final class SchedulerAccessor {
static Executor get(Target_java_lang_VirtualThread self) {
Expand Down
Loading