diff options
author | Matthew Newhook <matthew@zeroc.com> | 2002-04-20 13:12:48 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2002-04-20 13:12:48 +0000 |
commit | 59d264996ddc44c2d9d0465580f5e0787ccfbbd8 (patch) | |
tree | 3cb0676ed7ffbd8c5fc6dd900addfa2702ddbfc8 /cpp | |
parent | Added preliminary implementation of timed read/write trylock for RWRecMutex (diff) | |
download | ice-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.cpp | 28 |
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 |