summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Cond.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2003-04-17 03:15:58 +0000
committerBernard Normier <bernard@zeroc.com>2003-04-17 03:15:58 +0000
commit3176b44a88bfe6058159d5a24d160f57e960615c (patch)
treecb3ed89fa04355aec4433687b9a6dc81528cbd31 /cpp/include/IceUtil/Cond.h
parentfile FactoryTableDef.cpp was initially added on branch slicing. (diff)
downloadice-3176b44a88bfe6058159d5a24d160f57e960615c.tar.bz2
ice-3176b44a88bfe6058159d5a24d160f57e960615c.tar.xz
ice-3176b44a88bfe6058159d5a24d160f57e960615c.zip
Macro reorg/cleanup
Diffstat (limited to 'cpp/include/IceUtil/Cond.h')
-rw-r--r--cpp/include/IceUtil/Cond.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/Cond.h b/cpp/include/IceUtil/Cond.h
index 37973c059c3..f5b1d62220e 100644
--- a/cpp/include/IceUtil/Cond.h
+++ b/cpp/include/IceUtil/Cond.h
@@ -100,6 +100,10 @@ public:
template <typename Lock> inline void
wait(const Lock& lock) const
{
+ if (!lock.acquired())
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
waitImpl(lock._mutex);
}
@@ -113,6 +117,10 @@ public:
template <typename Lock> inline bool
timedWait(const Lock& lock, const Time& timeout) const
{
+ if (!lock.acquired())
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
return timedWaitImpl(lock._mutex, timeout);
}