diff options
author | Marc Laukien <marc@zeroc.com> | 2003-04-09 16:37:37 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-04-09 16:37:37 +0000 |
commit | a8bd4340198433bc239495b91aa7f6080e0f5b46 (patch) | |
tree | 8a4c7c5369561caa4913bad15024804c3a97c4a6 /cpp/test/IceUtil/thread/AliveTest.cpp | |
parent | Glacier request queue (diff) | |
download | ice-a8bd4340198433bc239495b91aa7f6080e0f5b46.tar.bz2 ice-a8bd4340198433bc239495b91aa7f6080e0f5b46.tar.xz ice-a8bd4340198433bc239495b91aa7f6080e0f5b46.zip |
fixes for RH9
Diffstat (limited to 'cpp/test/IceUtil/thread/AliveTest.cpp')
-rw-r--r-- | cpp/test/IceUtil/thread/AliveTest.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/cpp/test/IceUtil/thread/AliveTest.cpp b/cpp/test/IceUtil/thread/AliveTest.cpp index 6757406b3cf..4a7667dc496 100644 --- a/cpp/test/IceUtil/thread/AliveTest.cpp +++ b/cpp/test/IceUtil/thread/AliveTest.cpp @@ -13,9 +13,6 @@ // ********************************************************************** #include <IceUtil/IceUtil.h> - -#include <stdio.h> - #include <AliveTest.h> #include <TestCommon.h> @@ -24,17 +21,19 @@ using namespace IceUtil; static const string createTestName("thread alive"); -class CondVar : public IceUtil::Monitor<IceUtil::Mutex> +class CondVar : public IceUtil::Monitor<IceUtil::RecMutex> { public: - CondVar() : _done(false) + + CondVar() : + _done(false) { } void waitForSignal() { - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); - while (!_done) + IceUtil::Monitor<IceUtil::RecMutex>::Lock lock(*this); + while(!_done) { wait(); } @@ -42,18 +41,20 @@ public: void signal() { - IceUtil::Monitor<IceUtil::Mutex>::Lock lock(*this); + IceUtil::Monitor<IceUtil::RecMutex>::Lock lock(*this); _done = true; notify(); } private: + bool _done; }; class AliveTestThread : public Thread { public: + AliveTestThread(CondVar& childCreated, CondVar& parentReady) : _childCreated(childCreated), _parentReady(parentReady) { @@ -72,6 +73,7 @@ public: } private: + CondVar& _childCreated; CondVar& _parentReady; }; |