diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-08-24 16:43:37 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-08-24 16:43:37 +0000 |
commit | 4f81a765b310c1365e27196bd97bd90a0a0ac174 (patch) | |
tree | 1ccecfec8b414dfbf79b513cb606de30dcb46403 /cs/src/Ice/ObjectAdapterFactory.cs | |
parent | trap exception from checkedCast (diff) | |
download | ice-4f81a765b310c1365e27196bd97bd90a0a0ac174.tar.bz2 ice-4f81a765b310c1365e27196bd97bd90a0a0ac174.tar.xz ice-4f81a765b310c1365e27196bd97bd90a0a0ac174.zip |
Modified sync in shutdown
Diffstat (limited to 'cs/src/Ice/ObjectAdapterFactory.cs')
-rwxr-xr-x | cs/src/Ice/ObjectAdapterFactory.cs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cs/src/Ice/ObjectAdapterFactory.cs b/cs/src/Ice/ObjectAdapterFactory.cs index c5203b0240c..9e38b95a5ad 100755 --- a/cs/src/Ice/ObjectAdapterFactory.cs +++ b/cs/src/Ice/ObjectAdapterFactory.cs @@ -18,6 +18,8 @@ namespace IceInternal { public void shutdown() { + Hashtable adapters; + lock(this) { // @@ -28,17 +30,23 @@ namespace IceInternal { return; } - - foreach(Ice.ObjectAdapter adapter in _adapters.Values) - { - adapter.deactivate(); - } + + adapters = _adpaters; _instance = null; _communicator = null; System.Threading.Monitor.PulseAll(this); } + + // + // Deactivate outside the thread synchronization, to avoid + // deadlocks. + // + foreach(Ice.ObjectAdapter adapter in adapters.Values) + { + adapter.deactivate(); + } } public void waitForShutdown() |