summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceGrid/ServerI.cpp14
-rw-r--r--cpp/test/Ice/binding/Test.ice2
2 files changed, 7 insertions, 9 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp
index e74e7967a0c..07cbe4e4e60 100644
--- a/cpp/src/IceGrid/ServerI.cpp
+++ b/cpp/src/IceGrid/ServerI.cpp
@@ -1116,17 +1116,12 @@ ServerI::activate()
ServerCommandPtr command;
{
Lock sync(*this);
- if(_state != Activating)
- {
- //
- // It's possible that the server has already terminated.
- //
- return;
- }
+ assert(_state == Activating);
_pid = pid;
setStateNoSync(ServerI::WaitForActivation);
checkActivation();
command = nextCommand();
+ notifyAll(); // terminated() might already wait.
}
if(command)
{
@@ -1311,6 +1306,11 @@ ServerI::terminated(const string& msg, int status)
disableOnFailure();
}
+ while(_state == ServerI::Activating)
+ {
+ wait(); // Wait for activate() to set the state to WaitForActivation
+ }
+
if(_state == ServerI::Destroying)
{
destroying = true;
diff --git a/cpp/test/Ice/binding/Test.ice b/cpp/test/Ice/binding/Test.ice
index a00b7829c51..5400b2e607c 100644
--- a/cpp/test/Ice/binding/Test.ice
+++ b/cpp/test/Ice/binding/Test.ice
@@ -10,8 +10,6 @@
#ifndef TEST_ICE
#define TEST_ICE
-#include <Ice/Locator.ice>
-
module Test
{