summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/Instance.java
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-01-12 23:51:05 +0000
committerMarc Laukien <marc@zeroc.com>2003-01-12 23:51:05 +0000
commit801c87bf232fa112b58d52b5d95b1bd6e1a4bfdc (patch)
tree5736fe1a5339d1e237660444c32ddc7a6e7f093d /java/src/IceInternal/Instance.java
parentFix to display correct error message if imported file isn't found. (diff)
downloadice-801c87bf232fa112b58d52b5d95b1bd6e1a4bfdc.tar.bz2
ice-801c87bf232fa112b58d52b5d95b1bd6e1a4bfdc.tar.xz
ice-801c87bf232fa112b58d52b5d95b1bd6e1a4bfdc.zip
fixed deadlock
Diffstat (limited to 'java/src/IceInternal/Instance.java')
-rw-r--r--java/src/IceInternal/Instance.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java
index 3303a6da684..7ed0c30356d 100644
--- a/java/src/IceInternal/Instance.java
+++ b/java/src/IceInternal/Instance.java
@@ -273,6 +273,9 @@ public class Instance
_outgoingConnectionFactory.destroy();
_outgoingConnectionFactory.waitUntilFinished();
+ ThreadPool serverThreadPool = null;
+ ThreadPool clientThreadPool = null;
+
synchronized(this)
{
_objectAdapterFactory = null;
@@ -281,14 +284,14 @@ public class Instance
if(_serverThreadPool != null)
{
_serverThreadPool.destroy();
- _serverThreadPool.joinWithAllThreads();
+ serverThreadPool = _serverThreadPool;
_serverThreadPool = null;
}
if(_clientThreadPool != null)
{
_clientThreadPool.destroy();
- _clientThreadPool.joinWithAllThreads();
+ clientThreadPool = _clientThreadPool;
_clientThreadPool = null;
}
@@ -319,6 +322,19 @@ public class Instance
_destroyed = true;
}
+
+ //
+ // Join with the thread pool threads outside the
+ // synchronization.
+ //
+ if(clientThreadPool != null)
+ {
+ clientThreadPool.joinWithAllThreads();
+ }
+ if(serverThreadPool != null)
+ {
+ serverThreadPool.joinWithAllThreads();
+ }
}
private boolean _destroyed;