Integrated: 6995195: Static initialization deadlock in sun.java2d.loops.Blit and GraphicsPrimitiveMgr

Dmitry Cherepanov dcherepanov at openjdk.org
Thu Apr 27 07:28:58 UTC 2023


On Thu, 13 Apr 2023 13:03:37 GMT, Dmitry Cherepanov <dcherepanov at openjdk.org> wrote:

> This PR suggests to move generalPrimitives array to a new static nested GeneralPrimitives class to eliminate the possible deadlock. The Blit class (and other classes that register as general primitives) calls to GeneralPrimitives.register from the static initializer block without acquiring lock on the GraphicsPrimitiveMgr class.
> 
> This PR also includes a jtreg regression test which reproduces this issue without the patch and passes with the patch. Running tests from test/jdk/sun/java2d didn't reveal any issues with this patch.

This pull request has now been integrated.

Changeset: de0c05da
Author:    Dmitry Cherepanov <dcherepanov at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/de0c05da07859ee4552b73a39a35cc8cd37b78b0
Stats:     160 lines in 10 files changed: 118 ins; 33 del; 9 mod

6995195: Static initialization deadlock in sun.java2d.loops.Blit and GraphicsPrimitiveMgr

Reviewed-by: serb, aivanov

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

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



More information about the client-libs-dev mailing list