diff options
author | Marc Laukien <marc@zeroc.com> | 2003-01-12 23:51:05 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-01-12 23:51:05 +0000 |
commit | 801c87bf232fa112b58d52b5d95b1bd6e1a4bfdc (patch) | |
tree | 5736fe1a5339d1e237660444c32ddc7a6e7f093d /java/src/IceInternal/Instance.java | |
parent | Fix to display correct error message if imported file isn't found. (diff) | |
download | ice-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.java | 20 |
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; |