Access to Continuation.yield and ContinuationScope

Glavo zjx001202 at gmail.com
Thu Nov 25 01:37:02 UTC 2021


You can add the --add-opens option at runtime, like this:

java --add-opens java.base/jdk.internal.vm=ALL-UNNAMED <your-main-class>


Raul Raja Martinez <raulraja at gmail.com> 于2021年11月25日周四 上午7:56写道:

> Hello everyone,
>
> First, thank you for LOOM and the extraordinary work done here. I'm excited
> to see this coming to a final release.
>
> I have been using LOOM builds up until recently, building abstractions
> directly on top of what used to be `java.lang.Continuation` and the
> `Continuation.yield` capabilities. I have noticed in the latest build these
> became internal in the jdk.internal.vm package.
>
> When I link against those I get errors like:
>
> java.lang.IllegalAccessError: superclass access check failed: class
> fx.Continuation$package$$anon$1 (in unnamed module @0x1f75bcda) cannot
> access class jdk.internal.vm.ContinuationScope (in module java.base)
> because module java.base does not export jdk.internal.vm to unnamed module
> @0x1f75bcda
>
> I wondered if there is a way to create and use Continuation.yield in this
> latest build, and if not, how would I go about implementing a use case like
> this currently expressed in Scala.
>
> https://gist.github.com/raulraja/5bd7ffaf4f9fc44bf99fefc14a5e640e
>
> Thank you!
>
> Raul.
>


More information about the loom-dev mailing list