aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/share/javax/media
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2004-11-03 20:57:14 +0000
committerKevin Rushforth <[email protected]>2004-11-03 20:57:14 +0000
commit7b97aa387b8933c7e0ba61256fe3b11b1b8b189b (patch)
treeb0b2f05ca0f1e43e73b2ffd9abb77cec64795f48 /src/classes/share/javax/media
parent2b8ae14735ffdea883a31120af4b31554f6d1498 (diff)
1. Fixed a problem in setOffScreenBuffer that prevented native off-screen buffer from being created after a live scene graph was removed. With yesterday's fix, this caused a deadlock to occur.
2. Cleanup in construction of the MasterControl object. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@68 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/share/javax/media')
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java2
-rw-r--r--src/classes/share/javax/media/j3d/MasterControl.java13
-rw-r--r--src/classes/share/javax/media/j3d/VirtualUniverse.java19
3 files changed, 14 insertions, 20 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index 5b2af1f..4505897 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -1127,8 +1127,6 @@ public class Canvas3D extends Canvas {
(J3dI18N.getString("Canvas3D17"));
}
- VirtualUniverse.createMC();
-
this.offScreen = offScreen;
this.graphicsConfiguration = graphicsConfiguration;
diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java
index 04cf953..e6ddcc3 100644
--- a/src/classes/share/javax/media/j3d/MasterControl.java
+++ b/src/classes/share/javax/media/j3d/MasterControl.java
@@ -2792,6 +2792,19 @@ class MasterControl {
J3dDebug.doAssert((Screen3D.deviceRendererMap.get(gd) != null),
"Screen3D.deviceRendererMap.get(gd) != null");
+ // Create the master control thread if it isn't already created
+ boolean needToSetWork = false;
+ synchronized (mcThreadLock) {
+ if (mcThread == null) {
+ //System.err.println("Calling createMasterControlThread()");
+ createMasterControlThread();
+ needToSetWork = true;
+ }
+ }
+ if (needToSetWork) {
+ setWork();
+ }
+
// Fix for Issue 72 : call createRenderer rather than getting
// the renderer from the canvas.screen object
Renderer rdr = createRenderer(c.graphicsConfiguration);
diff --git a/src/classes/share/javax/media/j3d/VirtualUniverse.java b/src/classes/share/javax/media/j3d/VirtualUniverse.java
index 9d9273d..26a34db 100644
--- a/src/classes/share/javax/media/j3d/VirtualUniverse.java
+++ b/src/classes/share/javax/media/j3d/VirtualUniverse.java
@@ -144,9 +144,6 @@ public class VirtualUniverse extends Object {
// Root ThreadGroup for creating Java 3D threads
static ThreadGroup rootThreadGroup;
- // Lock for MasterControl Object creation
- static Object mcLock = new Object();
-
// Properties object for getProperties
private static J3dQueryProps properties = null;
@@ -192,20 +189,6 @@ public class VirtualUniverse extends Object {
}
- static void createMC() {
- synchronized (mcLock) {
- if (mc == null) {
- mc = new MasterControl();
- }
- }
- }
-
- static void destroyMC() {
- synchronized (mcLock) {
- mc = null;
- }
- }
-
/**
* Initialize the native interface and anything else that needs
* to be initialized.
@@ -252,7 +235,7 @@ public class VirtualUniverse extends Object {
// Load the native libraries and create the static
// MasterControl object
MasterControl.loadLibraries();
- createMC();
+ mc = new MasterControl();
// Print out debugging information for debug builds
if(VersionInfo.isDebug) {