summaryrefslogtreecommitdiff
path: root/cppe/test/IceE/thread/RecMutexTest.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-06-03 19:32:20 -0700
committerMark Spruiell <mes@zeroc.com>2008-06-03 19:32:20 -0700
commit3d649bed4328992f41f567136025f58a019a5159 (patch)
tree470be901fbbfe5c6cd4269884412b0d36b48dc92 /cppe/test/IceE/thread/RecMutexTest.cpp
parentlocal interface fixes for slice2javae (diff)
downloadice-3d649bed4328992f41f567136025f58a019a5159.tar.bz2
ice-3d649bed4328992f41f567136025f58a019a5159.tar.xz
ice-3d649bed4328992f41f567136025f58a019a5159.zip
Various Ice-E fixes:
- Bug fix in slice2javae for local interfaces/classes - Added Ice.LocalObjectHolder - Reviewed Java/C++ demos and aligned with Ice - Source code clean up (removed tabs, etc.)
Diffstat (limited to 'cppe/test/IceE/thread/RecMutexTest.cpp')
-rw-r--r--cppe/test/IceE/thread/RecMutexTest.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/cppe/test/IceE/thread/RecMutexTest.cpp b/cppe/test/IceE/thread/RecMutexTest.cpp
index 3d52bb13164..0e4d8c14fb7 100644
--- a/cppe/test/IceE/thread/RecMutexTest.cpp
+++ b/cppe/test/IceE/thread/RecMutexTest.cpp
@@ -22,34 +22,34 @@ class RecMutexTestThread : public Thread
public:
RecMutexTestThread(RecMutex& m) :
- _mutex(m),
- _tryLock(false)
+ _mutex(m),
+ _tryLock(false)
{
}
virtual void run()
{
-
- RecMutex::TryLock tlock(_mutex);
- test(!tlock.acquired());
-
- {
- Mutex::Lock lock(_tryLockMutex);
- _tryLock = true;
- }
- _tryLockCond.signal();
-
- RecMutex::Lock lock(_mutex);
+
+ RecMutex::TryLock tlock(_mutex);
+ test(!tlock.acquired());
+
+ {
+ Mutex::Lock lock(_tryLockMutex);
+ _tryLock = true;
+ }
+ _tryLockCond.signal();
+
+ RecMutex::Lock lock(_mutex);
}
void
waitTryLock()
{
- Mutex::Lock lock(_tryLockMutex);
- while(!_tryLock)
- {
- _tryLockCond.wait(lock);
- }
+ Mutex::Lock lock(_tryLockMutex);
+ while(!_tryLock)
+ {
+ _tryLockCond.wait(lock);
+ }
}
private:
@@ -78,22 +78,22 @@ RecMutexTest::run()
ThreadControl control;
{
- RecMutex::Lock lock(mutex);
-
- // TEST: lock twice
- RecMutex::Lock lock2(mutex);
-
- // TEST: TryLock
- RecMutex::TryLock lock3(mutex);
- test(lock3.acquired());
-
- // TEST: Start thread, try to acquire the mutex.
- t = new RecMutexTestThread(mutex);
- control = t->start();
-
- // TEST: Wait until the tryLock has been tested.
- t->waitTryLock();
-
+ RecMutex::Lock lock(mutex);
+
+ // TEST: lock twice
+ RecMutex::Lock lock2(mutex);
+
+ // TEST: TryLock
+ RecMutex::TryLock lock3(mutex);
+ test(lock3.acquired());
+
+ // TEST: Start thread, try to acquire the mutex.
+ t = new RecMutexTestThread(mutex);
+ control = t->start();
+
+ // TEST: Wait until the tryLock has been tested.
+ t->waitTryLock();
+
}
//