diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-04-04 08:36:45 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-04-04 08:36:45 +0000 |
commit | 03dd7345536f4166b133449fd64efa4088492ae5 (patch) | |
tree | 85a1866e179a589d74b67abeedca27bc4735cb83 /cpp | |
parent | attack test (diff) | |
download | ice-03dd7345536f4166b133449fd64efa4088492ae5.tar.bz2 ice-03dd7345536f4166b133449fd64efa4088492ae5.tar.xz ice-03dd7345536f4166b133449fd64efa4088492ae5.zip |
Fixes
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/test/Glacier2/router/Client.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/cpp/test/Glacier2/router/Client.cpp b/cpp/test/Glacier2/router/Client.cpp index aee08743c16..0634ca927ba 100644 --- a/cpp/test/Glacier2/router/Client.cpp +++ b/cpp/test/Glacier2/router/Client.cpp @@ -185,7 +185,7 @@ class StressClient : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mu { public: - StressClient(int id) : _id(id), _notified(false) + StressClient(int id) : _id(id), _initialized(false), _notified(false) { } @@ -220,6 +220,11 @@ public: { Lock sync(*this); + _initialized = true; + notifyAll(); + } + { + Lock sync(*this); while(!_notified) { wait(); @@ -239,9 +244,18 @@ public: void notifyThread() { - Lock sync(*this); - _notified = true; - notify(); + { + Lock sync(*this); + while(!_initialized) + { + wait(); + } + } + { + Lock sync(*this); + _notified = true; + notify(); + } } void @@ -255,8 +269,9 @@ public: catch(const Ice::ConnectionLostException&) { } - catch(const Ice::LocalException&) + catch(const Ice::LocalException& ex) { + cerr << ex << endl; test(false); } } @@ -266,6 +281,7 @@ protected: Glacier2::RouterPrx _router; int _id; CallbackReceiverIPtr _callbackReceiver; + bool _initialized; bool _notified; }; typedef IceUtil::Handle<StressClient> StressClientPtr; |