[FIXED] Freeze in Display.createWindow on windows

Started by jouvieje, November 07, 2013, 14:55:59

Previous topic - Next topic

jouvieje

I'm using lwjgl 2.9.1 #113 and experiences some random (rarely) deadlock on Display creation (Display inside a Canvas). Stacks at end of the post when the lock happens.
It rarely happens, but when it does it's usually the first time I run an app (slower start / not in the HD cache).

The freeze seem a regression introduced in #99 for the fix of the bug:
http://lwjgl.org/forum/index.php/topic,5222.msg27872.html
KeyboardFocusManager.clearMostRecentFocusOwner is now being called during Display.createWindow, which uses awt lock.

Thread [RenderLoopThread] (Suspended)	
	owns: Object  (id=28)	
	waiting for: Component$AWTTreeLock  (id=27)	
	KeyboardFocusManager.clearMostRecentFocusOwner(Component) line: 1824	
	GLCanvasDisplay_lwjgl$DisplayCanvas(Component).setFocusable(boolean) line: 7110	
	WindowsDisplay.clearAWTFocus() line: not available	
	WindowsDisplay.createWindow(DrawableLWJGL, DisplayMode, Canvas, int, int) line: not available	
	Display.createWindow() line: not available	
	Display.create(PixelFormat, Drawable, ContextAttribs) line: not available	
	GLCanvasDisplay_lwjgl.onStart() line: 227	
	RenderLoop$RenderLoopThread.run() line: 168	

Thread [main] (Suspended)	
	owns: WFramePeer  (id=26)	
	owns: Component$AWTTreeLock  (id=27)	
	WComponentPeer.pShow() line: not available [native method]	
	WFramePeer(WComponentPeer).show() line: 130	
	WFramePeer(WWindowPeer).realShow() line: 220	
	WFramePeer(WWindowPeer).show() line: 237	
	WFramePeer(WComponentPeer).setVisible(boolean) line: 120	
	GLFrame(Component).show() line: 1618	
	GLFrame(Window).show() line: 1042	
	GLFrame(Component).show(boolean) line: 1651	
	GLFrame(Component).setVisible(boolean) line: 1603	
	GLFrame(Window).setVisible(boolean) line: 1014	
	GLFrame.setVisible(boolean) line: 239	
	GLFrame.run() line: 55	
	OasisAtSun.main(String[]) line: 135

spasi

The clearAWTFocus() call on creation should now run in the EDT. Could you please try the next build?

jouvieje

I've tested with 2.9.1 #114 which fix this problem, and also verified the fix in #99 is still ok.
Thanks :)