[foreign-memaccess+abi] RFR: 8293367: Enable native access for modules not in the boot layer [v2]

Jorn Vernee jvernee at openjdk.org
Wed Sep 21 13:11:06 UTC 2022


On Tue, 20 Sep 2022 14:18:19 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> Adding a new API ModuleLayer.Controller.enableNativeAccess(Module).
>> Reworked thread safety of enable native access flag reading and setting.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review comments.

src/java.base/share/classes/java/lang/Module.java line 275:

> 273:     public boolean isNativeAccessEnabled() {
> 274:         Module target = enableNativeAccessHolder();
> 275:         synchronized(target) {

I'm not sure how much of a problem this is, but I guess since the module object is publicly accessible, it's theoretically possible that some user code is also locking on it.

For the record; alternative could be to add a private field to module with a dedicated lock Object for enabling native access. Though, I don't think that's needed at the moment.

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

PR: https://git.openjdk.org/panama-foreign/pull/729


More information about the panama-dev mailing list