[OpenJDK 2D-Dev]  Review Request: 8229810 NullPointerException getting bounds of GraphicsConfiguration
jayathirth.d.v at oracle.com
Wed Oct 9 06:07:36 UTC 2019
Thanks for the clarification.
Changes are fine.
> On 04-Oct-2019, at 3:19 AM, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:
> Hi, Jay.
>> I think we should drive device update through GraphicsEnvironment.displayChanged() and DisplayChangeListener instead of force updating bounds in GraphicsDevice.displayChanged in the constructor.
>> We can synchronise the GraphicsEnvironment.displayChanged() by calling it under CGraphicsEnvironment.initDevices() sync lock, this will force call DisplayChangeListener when devices are updated.
> Unfortunately, we cannot move the "displayChanged()" method under the lock,
> because this method will notify all DisplayChangedListener which might use some
> other locks, so we will have GraphicsEnvironment.sync->SomeOther locks order,
> and at the same time, some other thread may acquired SomeOther lock and tried to
> call CGraphicsEnvironment.getScreenDevices(), so we will get
> SomeOther->CGraphicsEnvironment.sync and this will cause a deadlock.
> Best regards, Sergey.
More information about the 2d-dev