summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltimer.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-05-31 16:54:05 -0500
committerDave Parks <davep@lindenlab.com>2022-05-31 16:54:05 -0500
commitfc7b5549cb6092194d11b8d87600f21992305c1c (patch)
tree40ef1776b4abd77405c60d64043f5782dfc3e4be /indra/llcommon/lltimer.cpp
parentdfa71e2bb59e81de93f626fada6975ae46b01bb6 (diff)
SL-17484 Fix for unit tests. Deprecate non-threaded LLQueuedThread and make lllfsthread threaded.
Diffstat (limited to 'indra/llcommon/lltimer.cpp')
-rw-r--r--indra/llcommon/lltimer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index 466f98f9b2..39dfee3755 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -68,7 +68,12 @@ LLTimer* LLTimer::sTimer = NULL;
void ms_sleep(U32 ms)
{
LL_PROFILE_ZONE_SCOPED;
- std::this_thread::sleep_for(std::chrono::microseconds(ms));
+ using TimePoint = std::chrono::steady_clock::time_point;
+ auto resume_time = TimePoint::clock::now() + std::chrono::milliseconds(ms);
+ while (TimePoint::clock::now() < resume_time)
+ {
+ std::this_thread::yield(); //note: don't use LLThread::yield here to avoid yielding for too long
+ }
}
U32 micro_sleep(U64 us, U32 max_yields)