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

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Thu Apr 18 07:06:35 PDT 2013


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.
>>


-- 
Best regards, Sergey.



More information about the macosx-port-dev mailing list