He-Pin commented on code in PR #1734:
URL: https://github.com/apache/pekko/pull/1734#discussion_r1922713777
##########
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala:
##########
@@ -73,4 +73,21 @@ private[dispatch] object VirtualThreadSupport {
}
}
+ /**
+ * Try to get the default scheduler of virtual thread.
+ */
+ def getVirtualThreadDefaultScheduler: ForkJoinPool =
+ try {
+ require(isSupported, "Virtual thread is not supported.")
+ val clazz = Class.forName("java.lang.VirtualThread")
+ val fieldName = "DEFAULT_SCHEDULER"
+ val field = clazz.getDeclaredField(fieldName)
+ field.setAccessible(true)
+ field.get(null).asInstanceOf[ForkJoinPool]
+ } catch {
Review Comment:
AT Work, I have a jpmsutil to add dynamic opens at fly, but still it need at
least two add opens to work in the first place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]