RFR: 8292202: modules_do is called without Module_lock

Ioi Lam iklam at openjdk.org
Thu Sep 15 18:39:59 UTC 2022


On Thu, 15 Sep 2022 18:01:33 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> Please review this fix which involves:
> 
> - acquire the `Module_lock` before calling `modules_do`;
> - move the call to `ClassLoader::setup_module_search_path `out of `do_module`;
> - save the module paths in a `GrowableArray` in `do_module` for calling `ClassLoader::setup_module_search_path`.
> 
> Passed tiers 1 - 3 testing.

Looks good. A minor suggestion to simplify the code.

src/hotspot/share/classfile/classLoaderExt.cpp line 99:

> 97:         char* path_copy = NEW_RESOURCE_ARRAY(char, strlen(path) + 1);
> 98:         strcpy(path_copy, path);
> 99:         _module_paths->at_put_grow(_total_count++, path_copy);

You can use `_module_paths->append()` to avoid keeping the `_total_count`

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

Marked as reviewed by iklam (Reviewer).

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


More information about the hotspot-runtime-dev mailing list