You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Read-Poller threads are special: if we run from a VThread managed by a VirtualThreadNettyScheduler,
51
-
// we want should continue using that same scheduler for the Read-Poller thread.
52
-
varcurrentThread = Thread.currentThread();
53
-
if (currentThread.isVirtual()) {
54
-
// TODO https://github.com/openjdk/loom/blob/12ddf39bb59252a8274d8b937bd075b2a6dbc3f8/src/java.base/share/classes/java/lang/VirtualThread.java#L270C18-L270C33
55
-
// in theory should be easy to provide a VirtualThreadTask::current method to avoid the ScopedValue lookup
// See https://github.com/openjdk/loom/blob/12ddf39bb59252a8274d8b937bd075b2a6dbc3f8/src/java.base/share/classes/sun/nio/ch/Poller.java#L723C48-L723C59
59
-
if (schedulerRef != null) {
60
-
varrunningScheduler = schedulerRef.get();
61
-
if (runningScheduler != null && virtualThreadTask.thread().getName().endsWith("-Read-Poller")) {
62
-
virtualThreadTask.attach(schedulerRef);
63
-
if (runningScheduler.execute(virtualThreadTask)) {
64
-
return;
57
+
if (perCarrierPollers) {
58
+
// Read-Poller threads are special: if we run from a VThread managed by a VirtualThreadNettyScheduler,
59
+
// we want should continue using that same scheduler for the Read-Poller thread.
60
+
varcurrentThread = Thread.currentThread();
61
+
if (currentThread.isVirtual()) {
62
+
// TODO https://github.com/openjdk/loom/blob/12ddf39bb59252a8274d8b937bd075b2a6dbc3f8/src/java.base/share/classes/java/lang/VirtualThread.java#L270C18-L270C33
63
+
// in theory should be easy to provide a VirtualThreadTask::current method to avoid the ScopedValue lookup
// See https://github.com/openjdk/loom/blob/12ddf39bb59252a8274d8b937bd075b2a6dbc3f8/src/java.base/share/classes/sun/nio/ch/Poller.java#L723C48-L723C59
67
+
if (schedulerRef != null) {
68
+
varrunningScheduler = schedulerRef.get();
69
+
if (runningScheduler != null && virtualThreadTask.thread().getName().endsWith("-Read-Poller")) {
70
+
virtualThreadTask.attach(schedulerRef);
71
+
if (runningScheduler.execute(virtualThreadTask)) {
0 commit comments