summaryrefslogtreecommitdiff
path: root/indra/llcommon/threadpool.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-01-20 02:26:51 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-01-22 18:47:43 +0200
commit4a34a1196627c7e9998edde725d5e839f3ef61b9 (patch)
treecbca0677ac1d4bb27e6d608f09fde45396a1d4cc /indra/llcommon/threadpool.h
parentfee2dc981cb15c54cacd63f778f106ff93a85796 (diff)
SL-18721 Shutdown fixes
1. After window closes viewer still takes some time to shut down, so added splash screen to not confuse users (and to see if something gets stuck) 2. Having two identical mWindowHandle caused confusion for me, so I split them. It looks like there might have been issues with thread being stuck because thread's handle wasn't cleaned up. 3. Made region clean mCacheMap immediately instead of spending time making copies on shutdown
Diffstat (limited to 'indra/llcommon/threadpool.h')
-rw-r--r--indra/llcommon/threadpool.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h
index 60f4a0ce1b..fa16c6fe71 100644
--- a/indra/llcommon/threadpool.h
+++ b/indra/llcommon/threadpool.h
@@ -40,7 +40,7 @@ namespace LL
* overrides this parameter.
*/
ThreadPoolBase(const std::string& name, size_t threads,
- WorkQueueBase* queue);
+ WorkQueueBase* queue, bool auto_shutdown = true);
virtual ~ThreadPoolBase();
/**
@@ -87,6 +87,7 @@ namespace LL
protected:
std::unique_ptr<WorkQueueBase> mQueue;
+ bool mAutomaticShutdown;
private:
void run(const std::string& name);
@@ -117,8 +118,11 @@ namespace LL
* Constraining the queue can cause a submitter to block. Do not
* constrain any ThreadPool accepting work from the main thread.
*/
- ThreadPoolUsing(const std::string& name, size_t threads=1, size_t capacity=1024*1024):
- ThreadPoolBase(name, threads, new queue_t(name, capacity))
+ ThreadPoolUsing(const std::string& name,
+ size_t threads=1,
+ size_t capacity=1024*1024,
+ bool auto_shutdown = true):
+ ThreadPoolBase(name, threads, new queue_t(name, capacity), auto_shutdown)
{}
~ThreadPoolUsing() override {}