summaryrefslogtreecommitdiff
path: root/indra/llcommon/llqueuedthread.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-12-09 16:34:28 -0500
committerNat Goodspeed <nat@lindenlab.com>2022-12-09 16:34:28 -0500
commitf41278082f2ab204ec60c15ee1530ca4440937a5 (patch)
treec382bb0e6cde299e853d09b19a47f1d82dc537fa /indra/llcommon/llqueuedthread.cpp
parentfc424a0db90fd2d2e44e85a19750ad6eaa57b28a (diff)
parente3b34fec6962e6deda3dd9dd83bf9fa20ab594af (diff)
SL-18809: Merge 'DRTVWR-559' of secondlife/viewer into sl-18809
Diffstat (limited to 'indra/llcommon/llqueuedthread.cpp')
-rw-r--r--indra/llcommon/llqueuedthread.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index e5060a1076..9b1de2e9a5 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -477,9 +477,14 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req)
mRequestQueue.post([=]
{
LL_PROFILE_ZONE_NAMED("processRequest - retry");
- while (LL::WorkQueue::TimePoint::clock::now() < retry_time)
+ if (LL::WorkQueue::TimePoint::clock::now() < retry_time)
{
- std::this_thread::yield(); //note: don't use LLThread::yield here to avoid
+ auto sleep_time = std::chrono::duration_cast<std::chrono::milliseconds>(retry_time - LL::WorkQueue::TimePoint::clock::now());
+
+ if (sleep_time.count() > 0)
+ {
+ ms_sleep(sleep_time.count());
+ }
}
processRequest(req);
});