Skip to content

Commit 5212001

Browse files
committed
Adapt JDK-8351927: Change VirtualThread implementation to use use FJP delayed task handling
1 parent e26ed26 commit 5212001

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Target_java_lang_VirtualThread.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ public final class Target_java_lang_VirtualThread {
100100
@TargetElement(onlyWith = JDK21OrEarlier.class) //
101101
private static ScheduledExecutorService UNPARKER;
102102

103-
@Alias //
104-
@InjectAccessors(DelayedTaskSchedulersAccessor.class) //
105-
@TargetElement(onlyWith = JDKLatest.class) //
106-
private static ScheduledExecutorService[] DELAYED_TASK_SCHEDULERS;
107-
108103
/** Go through {@link #nondefaultScheduler}. */
109104
@Alias //
110105
@InjectAccessors(SchedulerAccessor.class) //
@@ -134,10 +129,6 @@ public final class Target_java_lang_VirtualThread {
134129
@TargetElement(onlyWith = JDK21OrEarlier.class)
135130
private static native ScheduledExecutorService createDelayedTaskScheduler();
136131

137-
@Alias
138-
@TargetElement(onlyWith = JDKLatest.class)
139-
private static native ScheduledExecutorService[] createDelayedTaskSchedulers();
140-
141132
@SuppressWarnings("unused")
142133
private static final class AlwaysFalseAccessor {
143134
static boolean get(Target_java_lang_VirtualThread vt) {
@@ -192,28 +183,6 @@ private static synchronized ScheduledExecutorService initializeDelayedTaskSchedu
192183
}
193184
}
194185

195-
private static final class DelayedTaskSchedulersAccessor {
196-
private static volatile ScheduledExecutorService[] delayedTaskSchedulers;
197-
198-
@SuppressWarnings("unused")
199-
public static ScheduledExecutorService[] get() {
200-
ScheduledExecutorService[] result = delayedTaskSchedulers;
201-
if (result == null) {
202-
result = initializeDelayedTaskScheduler();
203-
}
204-
return result;
205-
}
206-
207-
private static synchronized ScheduledExecutorService[] initializeDelayedTaskScheduler() {
208-
ScheduledExecutorService[] result = delayedTaskSchedulers;
209-
if (result == null) {
210-
result = createDelayedTaskSchedulers();
211-
delayedTaskSchedulers = result;
212-
}
213-
return result;
214-
}
215-
}
216-
217186
@SuppressWarnings("unused")
218187
private static final class SchedulerAccessor {
219188
static Executor get(Target_java_lang_VirtualThread self) {

0 commit comments

Comments
 (0)