diff options
Diffstat (limited to 'cpp/src/Ice/ConnectionI.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index 38d6cac7992..dc50521f6cb 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -1152,41 +1152,21 @@ Ice::ConnectionI::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; - // - // We never change the thread pool with which we were - // initially registered, even if we add or remove an object - // adapter. - // - _adapter = adapter; - if(_adapter) - { - _servantManager = dynamic_cast<ObjectAdapterI*>(_adapter.get())->getServantManager(); - } - else - { - _servantManager = 0; - } + if(_adapter) + { + _servantManager = dynamic_cast<ObjectAdapterI*>(_adapter.get())->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 |