summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthreadsafequeue.h
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-11-15 09:25:35 -0700
committerDave Houlton <euclid@lindenlab.com>2021-11-15 09:25:35 -0700
commit029b41c0419e975bbb28454538b46dc69ce5d2ba (patch)
tree4f9a28bb36ee07fe9a7b45a434384afd1f24bb85 /indra/llcommon/llthreadsafequeue.h
parentaeed774ff9cc55c0c1dd2784e23b2366ff367fbe (diff)
Revert "SL-16220: Merge branch 'origin/DRTVWR-546' into glthread"
This reverts commit 5188a26a8521251dda07ac0140bb129f28417e49, reversing changes made to 819088563e13f1d75e048311fbaf0df4a79b7e19.
Diffstat (limited to 'indra/llcommon/llthreadsafequeue.h')
-rw-r--r--indra/llcommon/llthreadsafequeue.h30
1 files changed, 8 insertions, 22 deletions
diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h
index 5c934791fe..06e8d8f609 100644
--- a/indra/llcommon/llthreadsafequeue.h
+++ b/indra/llcommon/llthreadsafequeue.h
@@ -85,8 +85,8 @@ public:
LLThreadSafeQueue(U32 capacity = 1024);
virtual ~LLThreadSafeQueue() {}
- // Add an element to the queue (will block if the queue has reached
- // capacity).
+ // Add an element to the queue (will block if the queue has
+ // reached capacity).
//
// This call will raise an interrupt error if the queue is closed while
// the caller is blocked.
@@ -95,11 +95,6 @@ public:
// legacy name
void pushFront(ElementT const & element) { return push(element); }
- // Add an element to the queue (will block if the queue has reached
- // capacity). Return false if the queue is closed before push is possible.
- template <typename T>
- bool pushIfOpen(T&& element);
-
// Try to add an element to the queue without blocking. Returns
// true only if the element was actually added.
template <typename T>
@@ -316,8 +311,8 @@ bool LLThreadSafeQueue<ElementT, QueueT>::push_(lock_t& lock, T&& element)
template <typename ElementT, typename QueueT>
-template <typename T>
-bool LLThreadSafeQueue<ElementT, QueueT>::pushIfOpen(T&& element)
+template<typename T>
+void LLThreadSafeQueue<ElementT, QueueT>::push(T&& element)
{
lock_t lock1(mLock);
while (true)
@@ -326,10 +321,12 @@ bool LLThreadSafeQueue<ElementT, QueueT>::pushIfOpen(T&& element)
// drained or not: the moment either end calls close(), further push()
// operations will fail.
if (mClosed)
- return false;
+ {
+ LLTHROW(LLThreadSafeQueueInterrupt());
+ }
if (push_(lock1, std::forward<T>(element)))
- return true;
+ return;
// Storage Full. Wait for signal.
mCapacityCond.wait(lock1);
@@ -337,17 +334,6 @@ bool LLThreadSafeQueue<ElementT, QueueT>::pushIfOpen(T&& element)
}
-template <typename ElementT, typename QueueT>
-template<typename T>
-void LLThreadSafeQueue<ElementT, QueueT>::push(T&& element)
-{
- if (! pushIfOpen(std::forward<T>(element)))
- {
- LLTHROW(LLThreadSafeQueueInterrupt());
- }
-}
-
-
template<typename ElementT, typename QueueT>
template<typename T>
bool LLThreadSafeQueue<ElementT, QueueT>::tryPush(T&& element)