summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2020-07-28 11:38:31 -0700
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-07-28 21:46:21 +0300
commit24625c789833ac8762fba6ad31ab670d68acf3e8 (patch)
tree220852e9ec9c2caa1c8dcba9bd6ac6a3d67c968a
parent3f48ab1c0560d9a0c9401990aa4c9ddfca826d0b (diff)
Nat's suggested improvement to LLThreadSafeQueue that takes account of queue being empty as well as the status flag condition
-rw-r--r--indra/llcommon/llthreadsafequeue.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h
index 30dd507f73..26e0d71d31 100644
--- a/indra/llcommon/llthreadsafequeue.h
+++ b/indra/llcommon/llthreadsafequeue.h
@@ -304,14 +304,13 @@ template<typename ElementT>
bool LLThreadSafeQueue<ElementT>::isClosed()
{
lock_t lock(mLock);
- return mClosed;
+ return mClosed && mStorage.size() == 0;
}
template<typename ElementT>
LLThreadSafeQueue<ElementT>::operator bool()
{
- lock_t lock(mLock);
- return ! mClosed;
+ return ! isClosed();
}
#endif