Mercurial > hg > orthanc
diff Core/MultiThreading/SharedMessageQueue.h @ 1227:7266c37d0354
lifo policy in SharedMessageQueue
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 Nov 2014 11:58:47 +0100 |
parents | 8c67382f44a7 |
children | 6e7e5ed91c2d |
line wrap: on
line diff
--- a/Core/MultiThreading/SharedMessageQueue.h Wed Nov 19 11:15:34 2014 +0100 +++ b/Core/MultiThreading/SharedMessageQueue.h Thu Nov 20 11:58:47 2014 +0100 @@ -45,6 +45,7 @@ private: typedef std::list<IDynamicObject*> Queue; + bool isFifo_; unsigned int maxSize_; Queue queue_; boost::mutex mutex_; @@ -63,5 +64,19 @@ IDynamicObject* Dequeue(int32_t millisecondsTimeout); bool WaitEmpty(int32_t millisecondsTimeout); + + bool IsFifoPolicy() const + { + return isFifo_; + } + + bool IsLifoPolicy() const + { + return !isFifo_; + } + + void SetFifoPolicy(); + + void SetLifoPolicy(); }; }