diff options
Diffstat (limited to 'cpp/src/qpid/sys/PollableQueue.h')
-rw-r--r-- | cpp/src/qpid/sys/PollableQueue.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/PollableQueue.h b/cpp/src/qpid/sys/PollableQueue.h index ca97c0d8c9..2c326b998f 100644 --- a/cpp/src/qpid/sys/PollableQueue.h +++ b/cpp/src/qpid/sys/PollableQueue.h @@ -71,6 +71,9 @@ class PollableQueue { /** Stop polling and wait for the current callback, if any, to complete. */ void stop(); + + /** Are we currently stopped?*/ + bool isStopped() const; private: typedef sys::Monitor::ScopedLock ScopedLock; @@ -78,7 +81,7 @@ class PollableQueue { void dispatch(sys::DispatchHandle&); - sys::Monitor lock; + mutable sys::Monitor lock; Callback callback; PollableCondition condition; sys::DispatchHandle handle; @@ -130,6 +133,11 @@ template <class T> void PollableQueue<T>::stop() { while (dispatching) lock.wait(); } +template <class T> bool PollableQueue<T>::isStopped() const { + ScopedLock l(lock); + return stopped; +} + }} // namespace qpid::sys #endif /*!QPID_SYS_POLLABLEQUEUE_H*/ |