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.

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

Commit messages:
 - deadlock fix

Changes: https://git.openjdk.org/jdk/pull/13459/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13459&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-6995195
  Stats: 155 lines in 10 files changed: 113 ins; 33 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/13459.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13459/head:pull/13459

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

Reply via email to