< prev index next > src/java.base/share/classes/sun/nio/ch/Poller.java
Print this page
Poller readPoller = provider().readPoller(true);
readPollers.add(readPoller);
// start virtual thread to execute sub-polling loop
Thread carrier = JLA.currentCarrierThread();
! Thread.ofVirtual()
.inheritInheritableThreadLocals(false)
.name(carrier.getName() + "-Read-Poller")
! .uncaughtExceptionHandler((_, e) -> e.printStackTrace())
! .start(() -> subPollerLoop(readPoller));
return readPoller;
}
/**
* Returns the read poller for the current carrier, starting it if required.
Poller readPoller = provider().readPoller(true);
readPollers.add(readPoller);
// start virtual thread to execute sub-polling loop
Thread carrier = JLA.currentCarrierThread();
! Thread.Builder.OfVirtual builder = Thread.ofVirtual()
.inheritInheritableThreadLocals(false)
.name(carrier.getName() + "-Read-Poller")
! .uncaughtExceptionHandler((_, e) -> e.printStackTrace());
! Thread thread = JLA.defaultVirtualThreadScheduler()
+ .newThread(builder, carrier, () -> subPollerLoop(readPoller))
+ .thread();
+ thread.start();
return readPoller;
}
/**
* Returns the read poller for the current carrier, starting it if required.
< prev index next >