From ff5496239bffadaca111b1e4380a01447f85843a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 5 Nov 2021 12:33:31 -0400 Subject: SL-16202: Use WorkQueue::postTo() for texture create/post handshake. That is, when LLViewerFetchedTexture::scheduleCreateTexture() wants to call createTexture() on the LLImageGLThread, but postCreateTexture() on the main thread, use the "mainloop" WorkQueue to set up the handshake. Give ThreadPool a public virtual run() method so a subclass can override with desired behavior. This necessitates a virtual destructor. Add accessors for embedded WorkQueue (for post calls), ThreadPool name and width (in threads). Allow LLSimpleton::createInstance() to forward arguments to the subject constructor. Make LLImageGLThread an LLSimpleton - that abstraction didn't yet exist at the time LLImageGLThread was coded. Also derive from ThreadPool rather than LLThread. Make it a single-thread "pool" with a very large queue capacity. --- indra/llcommon/threadpool.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/threadpool.cpp') diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index e4fa0eccf3..cf25cc838e 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -70,6 +70,11 @@ void LL::ThreadPool::close() void LL::ThreadPool::run(const std::string& name) { LL_DEBUGS("ThreadPool") << name << " starting" << LL_ENDL; - mQueue.runUntilClose(); + run(); LL_DEBUGS("ThreadPool") << name << " stopping" << LL_ENDL; } + +void LL::ThreadPool::run() +{ + mQueue.runUntilClose(); +} -- cgit v1.2.3