summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/Connection.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-11-08 00:01:13 +0000
committerMarc Laukien <marc@zeroc.com>2005-11-08 00:01:13 +0000
commit65b74644be770fa3c67f0260fe50462d1e3aa202 (patch)
treed0d8479b2d45726d7a2b70cfbf8b21c008ab07f2 /cppe/src/IceE/Connection.cpp
parentChanges to allow test suite to run with compressionn on but not available (diff)
downloadice-65b74644be770fa3c67f0260fe50462d1e3aa202.tar.bz2
ice-65b74644be770fa3c67f0260fe50462d1e3aa202.tar.xz
ice-65b74644be770fa3c67f0260fe50462d1e3aa202.zip
fixed bi-dir/shutdown deadlock
Diffstat (limited to 'cppe/src/IceE/Connection.cpp')
-rwxr-xr-xcppe/src/IceE/Connection.cpp41
1 files changed, 13 insertions, 28 deletions
diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp
index 4fe759eafdd..a02a644a671 100755
--- a/cppe/src/IceE/Connection.cpp
+++ b/cppe/src/IceE/Connection.cpp
@@ -691,36 +691,21 @@ Ice::Connection::setAdapter(const ObjectAdapterPtr& adapter)
assert(_state < StateClosing);
- //
- // Before we set an adapter (or reset it) we wait until the
- // dispatch count with any old adapter is zero.
- //
- // A deadlock can occur if we wait while an operation is
- // outstanding on this adapter that holds a lock while
- // calling this function (e.g., __getDelegate).
- //
- // In order to avoid such a deadlock, we only wait if the new
- // adapter is different than the current one.
- //
- // TODO: Verify that this fix solves all cases.
- //
- if(_adapter.get() != adapter.get())
- {
- while(_dispatchCount > 0)
- {
- wait();
- }
+ _adapter = adapter;
- _adapter = adapter;
- if(_adapter)
- {
- _servantManager = _adapter->getServantManager();
- }
- else
- {
- _servantManager = 0;
- }
+ if(_adapter)
+ {
+ _servantManager = _adapter->getServantManager();
}
+ else
+ {
+ _servantManager = 0;
+ }
+
+ //
+ // We never change the thread pool with which we were initially
+ // registered, even if we add or remove an object adapter.
+ //
}
ObjectAdapterPtr