Skip to content

Commit cf692c4

Browse files
committed
SL-18721: Faster viewer shutdown time since performance improvements can lead to perceived inventory loss due to cache corruption
1 parent c23353c commit cf692c4

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

indra/llcommon/threadpool.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ void LL::ThreadPool::start()
3939
run(tname);
4040
});
4141
}
42+
43+
// Special workflow for LLWindowWin32Thread - it's close() should be called explicitly
44+
if (mExplicitShutdown)
45+
return;
46+
4247
// Listen on "LLApp", and when the app is shutting down, close the queue
4348
// and join the workers.
4449
LLEventPumps::instance().obtain("LLApp").listen(

indra/llcommon/threadpool.h

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ namespace LL
5959
*/
6060
virtual void run();
6161

62+
protected:
63+
// LLWindowWin32Thread should set this flag to true
64+
bool mExplicitShutdown { false };
65+
6266
private:
6367
void run(const std::string& name);
6468

indra/llwindow/llwindowwin32.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -4581,6 +4581,9 @@ std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
45814581
inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread()
45824582
: ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE)
45834583
{
4584+
// Set this flag to true to avoid of implicit call of close() from start()
4585+
mExplicitShutdown = true;
4586+
45844587
ThreadPool::start();
45854588
}
45864589

0 commit comments

Comments
 (0)