From 24625c789833ac8762fba6ad31ab670d68acf3e8 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 28 Jul 2020 11:38:31 -0700 Subject: Nat's suggested improvement to LLThreadSafeQueue that takes account of queue being empty as well as the status flag condition --- indra/llcommon/llthreadsafequeue.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/llthreadsafequeue.h') 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 bool LLThreadSafeQueue::isClosed() { lock_t lock(mLock); - return mClosed; + return mClosed && mStorage.size() == 0; } template LLThreadSafeQueue::operator bool() { - lock_t lock(mLock); - return ! mClosed; + return ! isClosed(); } #endif -- cgit v1.2.3