summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-04-20 13:12:48 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-04-20 13:12:48 +0000
commit59d264996ddc44c2d9d0465580f5e0787ccfbbd8 (patch)
tree3cb0676ed7ffbd8c5fc6dd900addfa2702ddbfc8 /cpp
parentAdded preliminary implementation of timed read/write trylock for RWRecMutex (diff)
downloadice-59d264996ddc44c2d9d0465580f5e0787ccfbbd8.tar.bz2
ice-59d264996ddc44c2d9d0465580f5e0787ccfbbd8.tar.xz
ice-59d264996ddc44c2d9d0465580f5e0787ccfbbd8.zip
Added preliminary implementation of timed read/write trylock for
RWRecMutex.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/IceUtil/thread/RWRecMutexTest.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/cpp/test/IceUtil/thread/RWRecMutexTest.cpp b/cpp/test/IceUtil/thread/RWRecMutexTest.cpp
index 09fff54b7db..b8d1d3b8886 100644
--- a/cpp/test/IceUtil/thread/RWRecMutexTest.cpp
+++ b/cpp/test/IceUtil/thread/RWRecMutexTest.cpp
@@ -306,6 +306,16 @@ RWRecMutexTest::run()
{
// Expected
}
+
+ try
+ {
+ RWRecMutex::TryWLock wlock(mutex, 10);
+ test(false);
+ }
+ catch(const LockedException&)
+ {
+ // Expected
+ }
}
// TEST: TryLock (write)
@@ -324,6 +334,15 @@ RWRecMutexTest::run()
}
try
{
+ RWRecMutex::TryRLock rlock(mutex, 10);
+ test(false);
+ }
+ catch(const LockedException&)
+ {
+ // Expected
+ }
+ try
+ {
RWRecMutex::TryWLock wlock(mutex);
// Expected
}
@@ -331,6 +350,15 @@ RWRecMutexTest::run()
{
test(false);
}
+ try
+ {
+ RWRecMutex::TryWLock wlock(mutex, 10);
+ // Expected
+ }
+ catch(const LockedException&)
+ {
+ test(false);
+ }
}
// TEST: read lock