Use ACE_GUARD_RETURN macro in LockedQueue::next to guarrantee the lock is acquired before changing the queue´s properties

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-05-05 21:46:54 +02:00
parent 6ead23e353
commit 62dc839819
+2 -1
View File
@@ -68,7 +68,8 @@ namespace ACE_Based
//! Gets the next result in the queue, if any. //! Gets the next result in the queue, if any.
bool next(T& result) bool next(T& result)
{ {
ACE_Guard<LockType> g(this->_lock); // ACE_Guard<LockType> g(this->_lock);
ACE_GUARD_RETURN (LockType, g, this->_lock, false);
if (_queue.empty()) if (_queue.empty())
return false; return false;