<AWT Dev> [8] Request for review: 8009012 [macosx] DisplayChangedListener is not implemented in LWWindowPeer/CGraphicsEnvironment

Anthony Petrov anthony.petrov at oracle.com
Thu Apr 18 07:13:58 PDT 2013


I see. But this still looks fishy. Could you file a separate issue to 
investigate the replaceSurfaceData() calls and see if we can redispatch 
them all to the AppKit thread, thus clarifying the contract for the 
nativeSetScale as well?

The fix looks good otherwise.

--
best regards,
Anthony

On 04/18/13 18:06, Sergey Bylokhov wrote:
> Hi, Anthony.
> Currently this method is called from the replaceSurfaceData, which
> usually is called on the appkit, but can be called on a other thread. So
> this change don't block other thread.
> If it was called on appkit it completes synchronously, or asynchronously
> on another thread.
>
> On 4/18/13 5:54 PM, Anthony Petrov wrote:
>> 219 [ThreadUtilities performOnMainThreadWaiting:[NSThread
>> isMainThread] block:^(){
>>
>> That's an interesting pattern, but it looks more like a workaround to
>> me, because the contract defined by the nativeSetScale is unclear with
>> this implementation. Where do we call this method from? Can we ensure
>> all calls always occur on a specific thread?
>>
>> --
>> best regards,
>> Anthony
>>
>> On 04/17/13 13:42, Sergey Bylokhov wrote:
>>> Hello,
>>> Please review the fix for jdk 8.
>>> displayChanged() was added to LWWindowPeer and CGraphicsDevice. Note
>>> that I move out unnecessary calls to the appkit thread(in
>>> CGLayer.nativeSetScale() and CGraphicsDevice.getX), because it can cause
>>> a deadlock, when called from the non-appkit thread.
>>>
>>> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8009012
>>> Webrev can be found at:
>>> http://cr.openjdk.java.net/~serb/8009012/webrev.00
>>>
>>> --
>>> Best regards, Sergey.
>>>
>
>



More information about the awt-dev mailing list