From fb6a0f10c3cf96b701f0dff93171aac18733428f Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 26 Sep 2013 14:44:42 -0700 Subject: [PATCH] Add LockFreeStack::empty --- src/beast/beast/intrusive/LockFreeStack.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/beast/beast/intrusive/LockFreeStack.h b/src/beast/beast/intrusive/LockFreeStack.h index c68420480..a765bbf9e 100644 --- a/src/beast/beast/intrusive/LockFreeStack.h +++ b/src/beast/beast/intrusive/LockFreeStack.h @@ -182,6 +182,12 @@ public: { } + /** Returns true if the stack is empty. */ + bool empty() const + { + return m_head.get() == &m_end; + } + /** Return the number of elements in the stack. Thread safety: Safe to call from any thread.