diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index f7cd940a06..8329041a5c 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -343,8 +343,10 @@ bool LLThreadSafeQueue::pushIfOpen(T&& element) // Storage Full. Wait for signal. // [FIRE-32453][BUG-232971] Improve shutdown behaviour. Time bound the sleep - // When the queue is full and the consuming thread has exited we will never wake up. - const auto timeout = std::chrono::milliseconds(50); + // mCapacityCond.wait(lock1); + // When the queue is full and the consuming thread has exited we would never wake up. + // For safety, we now wait max half a second then recheck close. + const auto timeout = std::chrono::milliseconds(500); mCapacityCond.wait_for(lock1, timeout); // } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 1b9b65b346..f146b71b6e 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -925,6 +925,10 @@ void LLWindowWin32::close() // operations we're asking. That's the last time WE should touch it. mhDC = NULL; mWindowHandle = NULL; + // [FIRE-32453][BUG-232971] close the related queues first to prevent spinning. + mFunctionQueue.close(); + mMouseQueue.close(); + // mWindowThread->close(); }