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

lawrence.andrews duke at openjdk.org
Thu Apr 13 21:34:34 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.

src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java line 281:

> 279:             }
> 280:             return null;
> 281:             //throw new InternalError("No general handler registered for"+signature);

This line can be deleted if no longer needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13459#discussion_r1166050310



More information about the client-libs-dev mailing list