Integrated: 8303674: JFR: TypeLibrary class not thread safe
Erik Gahlin
egahlin at openjdk.org
Fri Mar 10 17:13:24 UTC 2023
On Mon, 6 Mar 2023 18:45:59 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> Could I have review of a PR that makes the TypeLibrary class thread safe.
>
> The problem occur when an application creates new AnnotationElement to use for dynamic events. The new types/classes need to be added to the type library, but the MetadataRepository lock can't be used for various reasons.
>
> The biggest risk with this change is the introduction of a dead lock between the metadata lock and the type library lock. During testing I added a check to all synchronised methods in MetadataRepository to ensure lock ordering is never violated.
>
> A better solution may be a separate lock class that TypeLibrary and MetadataRepository could share, but it's a large change and not so suitable for a backport.
>
> Testing: 100 * jdk/jdk/jfr
>
> Thanks
> Erik
This pull request has now been integrated.
Changeset: 9dd7b879
Author: Erik Gahlin <egahlin at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/9dd7b8799700e938688a28c8a2c14826eee96f5c
Stats: 46 lines in 2 files changed: 3 ins; 9 del; 34 mod
8303674: JFR: TypeLibrary class not thread safe
Reviewed-by: mgronlun
-------------
PR: https://git.openjdk.org/jdk/pull/12884
More information about the hotspot-jfr-dev
mailing list