RFR: 8301578: Perform output outside synchronization in Module.class [v3]

ExE Boss duke at openjdk.org
Sun Feb 5 18:48:50 UTC 2023


On Wed, 1 Feb 2023 07:52:25 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/Module.java line 281:
>> 
>>> 279: 
>>> 280:     private static boolean isNativeAccessEnabled(Module target) {
>>> 281:         if (target.enableNativeAccess)
>> 
>> @minborg It'd seem a bit easier to implement using VarHandle and not having to use `synchronized`? Is the reason that you don't want to init VarHandle in this class? 🤔
>
> It is a bootstrap problem. We cannot use AtomicBoolean, VarHandle or Unsafe here.

Shouldn’t `Unsafe` already be loaded at this point?

-------------

PR: https://git.openjdk.org/jdk/pull/12193


More information about the core-libs-dev mailing list