summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/ServerI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-02-14 10:20:57 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-02-14 10:20:57 +0000
commit5e18202075d8af900fec950f7163f7f27bf966fb (patch)
tree2c7e7dffd64da0dff640a4b4acb270bfa6fa4dd2 /cpp/src/IceGrid/ServerI.cpp
parentAdded --sort-fields to slice2docbook. (diff)
downloadice-5e18202075d8af900fec950f7163f7f27bf966fb.tar.bz2
ice-5e18202075d8af900fec950f7163f7f27bf966fb.tar.xz
ice-5e18202075d8af900fec950f7163f7f27bf966fb.zip
Fixed another race condition in the activator test suite.
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r--cpp/src/IceGrid/ServerI.cpp14
1 files changed, 7 insertions, 7 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;