summaryrefslogtreecommitdiff
path: root/indra/llcommon/threadpool.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-11-23 20:39:32 -0500
committerNat Goodspeed <nat@lindenlab.com>2021-11-23 20:39:32 -0500
commit2b96f89c2a374d72c0a8bc28a7b06ad4db7eae6e (patch)
tree00a275eefc21861b5ec70c50fb75235411f1ffa6 /indra/llcommon/threadpool.h
parent6d36038e4098ebe7334284fc9b3fb76bc116c106 (diff)
SL-16400: Add ThreadPool::start() method, and call it.
It's sometimes important to finish other initialization before launching the threads in the ThreadPool, so make that an explicit step. In particular, we were launching the LLImageGL texture thread before initializing the GL context, resulting in all gray textures.
Diffstat (limited to 'indra/llcommon/threadpool.h')
-rw-r--r--indra/llcommon/threadpool.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h
index 1ca24aec58..b79c9b9090 100644
--- a/indra/llcommon/threadpool.h
+++ b/indra/llcommon/threadpool.h
@@ -33,6 +33,14 @@ namespace LL
virtual ~ThreadPool();
/**
+ * Launch the ThreadPool. Until this call, a constructed ThreadPool
+ * launches no threads. That permits coders to derive from ThreadPool,
+ * or store it as a member of some other class, but refrain from
+ * launching it until all other construction is complete.
+ */
+ void start();
+
+ /**
* ThreadPool listens for application shutdown messages on the "LLApp"
* LLEventPump. Call close() to shut down this ThreadPool early.
*/
@@ -54,6 +62,7 @@ namespace LL
WorkQueue mQueue;
std::string mName;
+ size_t mThreadCount;
std::vector<std::pair<std::string, std::thread>> mThreads;
};