From 896e8b021b39e9415040a57a1d540d7d24b02db1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 14 Mar 2013 10:48:44 +0100 Subject: OSX/CALayer: Revise CALayer 'RunOnMainThread' utilization, avoiding deadlocks RunOnMainThread(waitUntilDone:=true,..) can deadlock the main-thread if called from AWT-EDT, since the main-thread may call back to AWT-EDT while injecting a new main-thread task. This patch revises all RunOnMainThread CALayer usage, resulting in only one required left: - OSXUtil.AddCASublayer() w/ waitUntilDone:=false Hence the CALayer code has no more potential to deadlock main-thread/AWT-EDT. OSXUtil.AddCASublayer() must be performed on main-thread, otherwise the CALayer attachment will fail - no visible rendering result. +++ Note: A good trigger to test this deadlock is to magnify/zoom the OSX desktop (click background + ctrl-mouse_wheel) before running some unit tests. TestGLCanvasAWTActionDeadlock01AWT and TestAddRemove02GLWindowNewtCanvasAWT also have the potential to trigger the mentioned deadlock. --- .../classes/javax/media/nativewindow/OffscreenLayerSurface.java | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/nativewindow/classes/javax') diff --git a/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java b/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java index 4885d5a4c..df3f04f7f 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/OffscreenLayerSurface.java @@ -36,10 +36,6 @@ public interface OffscreenLayerSurface { *

* Implementation may realize all required resources at this point. *

- *

- * It is mandatory that any related resources, e.g. a shared context, - * are not locked while calling this method. - *

* * @see #isOffscreenLayerSurfaceEnabled() * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false -- cgit v1.2.3