summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/hello/Client.cpp4
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp7
-rw-r--r--cpp/src/Ice/Instance.cpp3
-rw-r--r--cpp/src/Ice/ThreadPool.cpp20
4 files changed, 9 insertions, 25 deletions
diff --git a/cpp/demo/Ice/hello/Client.cpp b/cpp/demo/Ice/hello/Client.cpp
index a56ddd291a8..ae44f23413d 100644
--- a/cpp/demo/Ice/hello/Client.cpp
+++ b/cpp/demo/Ice/hello/Client.cpp
@@ -139,6 +139,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
twoway->shutdown();
}
+ else if (c == 'x')
+ {
+ // Nothing to do
+ }
else if (c == '?')
{
menu();
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 85db7a08a7a..eea0778af89 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -28,18 +28,11 @@ Ice::CommunicatorI::destroy()
{
JTCSyncT<JTCRecursiveMutex> sync(*this);
- shutdown();
-
if (_instance)
{
_instance->destroy();
_instance = 0;
}
-
- //
- // Don't set _threadPool to null here! See the comments in the
- // header file.
- //
}
void
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 5be7f7c3dca..f63938cae95 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -382,8 +382,7 @@ IceInternal::Instance::destroy()
if(_objectAdapterFactory)
{
- // No destroy function defined
- // _objectAdapterFactory->destroy();
+ _objectAdapterFactory->shutdown(); // ObjectAdapterFactory has shutdown(), not destroy()
_objectAdapterFactory = 0;
}
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index e00cc92c324..30b2f3ef6ec 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -171,6 +171,7 @@ void
IceInternal::ThreadPool::destroy()
{
JTCSyncT<JTCMonitorT<JTCMutex> > sync(*this);
+ assert(_instance);
_instance = 0;
setInterrupt();
}
@@ -209,17 +210,16 @@ IceInternal::ThreadPool::setInterrupt()
void
IceInternal::ThreadPool::run()
{
- bool shutdown = false;
-
while (true)
{
_threadMutex.lock();
+ bool shutdown = false;
EventHandlerPtr handler;
InstancePtr instance;
repeatSelect:
-
+
if (shutdown) // Shutdown has been initiated
{
shutdown = false;
@@ -276,20 +276,10 @@ IceInternal::ThreadPool::run()
}
bool again = false;
-
if (FD_ISSET(_fdIntrRead, &fdSet))
{
+ again = true;
shutdown = clearInterrupt();
- if (shutdown)
- {
- again = true;
- }
-
-#ifdef WIN32
- FD_CLR(static_cast<u_int>(_fdIntrRead), &fdSet);
-#else
- FD_CLR(_fdIntrRead, &fdSet);
-#endif
}
if (!_adds.empty())
@@ -305,7 +295,6 @@ IceInternal::ThreadPool::run()
_minFd = min(_minFd, p->first);
}
_adds.clear();
- again = true;
}
if (!_removes.empty())
@@ -337,7 +326,6 @@ IceInternal::ThreadPool::run()
_maxFd = max(_maxFd, (--_handlers.end())->first);
_minFd = min(_minFd, (--_handlers.end())->first);
}
- again = true;
if (_handlers.empty() || _servers == 0)
{
notifyAll(); // For waitUntil...Finished() methods