aboutsummaryrefslogtreecommitdiff
path: root/src/shared/LockedQueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/LockedQueue.h')
-rw-r--r--src/shared/LockedQueue.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/shared/LockedQueue.h b/src/shared/LockedQueue.h
index 6543487da81..7585989fdd0 100644
--- a/src/shared/LockedQueue.h
+++ b/src/shared/LockedQueue.h
@@ -15,16 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#ifndef LOCKEDQUEUE_H
#define LOCKEDQUEUE_H
-
#include <ace/Guard_T.h>
#include <ace/Thread_Mutex.h>
#include <deque>
#include <assert.h>
#include "Errors.h"
-
namespace ACE_Based
{
template <class T, class LockType, typename StorageType=std::deque<T> >
@@ -32,56 +29,41 @@ namespace ACE_Based
{
//! Lock access to the queue.
LockType _lock;
-
//! Storage backing the queue.
StorageType _queue;
-
//! Cancellation flag.
volatile bool _canceled;
-
public:
-
//! Create a LockedQueue.
LockedQueue() : _canceled(false) {}
-
//! Destroy a LockedQueue.
virtual ~LockedQueue() { }
-
//! Adds an item to the queue.
void add(const T& item)
{
ACE_Guard<LockType> g(this->_lock);
-
//ASSERT(!this->_canceled);
// throw Cancellation_Exception();
-
_queue.push_back(item);
}
-
//! Gets the next result in the queue, if any.
bool next(T& result)
{
ACE_Guard<LockType> g(this->_lock);
-
if (_queue.empty())
return false;
-
//ASSERT (!_queue.empty() || !this->_canceled);
// throw Cancellation_Exception();
result = _queue.front();
_queue.pop_front();
-
return true;
}
-
//! Cancels the queue.
void cancel()
{
ACE_Guard<LockType> g(this->_lock);
-
_canceled = true;
}
-
//! Checks if the queue is cancelled.
bool cancelled()
{