diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-07-19 10:47:11 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-07-20 20:32:48 +0300 |
| commit | ce21ab1950b685b84ba0651d51cc4c200763860c (patch) | |
| tree | 86b4226dc4163ec01a55a00ca8d56be784a00cc6 /indra/llcommon/llqueuedthread.cpp | |
| parent | 331c3c758a114d23950ab23bb94ee19e85e662dd (diff) | |
#6014 Reduce shutdown delays on thread cleanup
Diffstat (limited to 'indra/llcommon/llqueuedthread.cpp')
| -rw-r--r-- | indra/llcommon/llqueuedthread.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index efeeb1340e..8c740956b3 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -222,6 +222,33 @@ void LLQueuedThread::waitOnPending() return; } +void LLQueuedThread::waitOnPending(F32 max_time_sec) +{ + LLTimer wait_timer; + wait_timer.reset(); + while (1) + { + update(0); + + if (mIdleThread) + { + break; + } + + if (wait_timer.getElapsedTimeF64() >= max_time_sec) + { + LL_WARNS() << "waitOnPending() timed out after " << max_time_sec + << " seconds in thread: " << mName << LL_ENDL; + break; + } + + if (mThreaded) + { + yield(); + } + } +} + // MAIN thread void LLQueuedThread::printQueueStats() { |
