From 62c048b3666d71f8fefe9c2571548f250a5ef74a Mon Sep 17 00:00:00 2001 From: Kevin Rushforth Date: Mon, 30 Oct 2006 19:08:55 +0000 Subject: Fixed issue 370: Deadlock when calling Raster.setimage from user thread git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@733 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/classes/share/javax/media/j3d/RasterRetained.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/classes') diff --git a/src/classes/share/javax/media/j3d/RasterRetained.java b/src/classes/share/javax/media/j3d/RasterRetained.java index 5a20a45..b1aa0d4 100644 --- a/src/classes/share/javax/media/j3d/RasterRetained.java +++ b/src/classes/share/javax/media/j3d/RasterRetained.java @@ -254,14 +254,18 @@ class RasterRetained extends GeometryRetained { } TextureRetained oldTex = this.texture; - geomLock.getLock(); if (source.isLive()) { if (this.texture != null) { this.texture.clearLive(refCount); } } - + + // Issue 370: only hold the geomLock while calling initImage + // (cannot hold it while sending a message). + geomLock.getLock(); initImage(img); + geomLock.unLock(); + if (source.isLive()) { if (texture != null) { texture.setLive(inBackgroundGroup, refCount); @@ -270,7 +274,6 @@ class RasterRetained extends GeometryRetained { sendChangedMessage((J3dThread.UPDATE_RENDER|J3dThread.UPDATE_RENDERING_ATTRIBUTES), oldTex, this.texture); } - geomLock.unLock(); } /** -- cgit v1.2.3