summaryrefslogtreecommitdiff
path: root/indra/llcommon/threadpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/threadpool.cpp')
-rw-r--r--indra/llcommon/threadpool.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp
index d5adf11264..22bbff4478 100644
--- a/indra/llcommon/threadpool.cpp
+++ b/indra/llcommon/threadpool.cpp
@@ -21,11 +21,12 @@
#include "llevents.h"
#include "stringize.h"
-LL::ThreadPool::ThreadPool(const std::string& name, size_t threads, size_t capacity):
+LL::ThreadPool::ThreadPool(const std::string& name, size_t threads, size_t capacity, bool auto_shutdown):
super(name),
mQueue(name, capacity),
mName("ThreadPool:" + name),
- mThreadCount(threads)
+ mThreadCount(threads),
+ mAutomaticShutdown(auto_shutdown)
{}
void LL::ThreadPool::start()
@@ -39,6 +40,13 @@ void LL::ThreadPool::start()
run(tname);
});
}
+
+ // Some threads might need to run longer than LLEventPumps
+ if (!mAutomaticShutdown)
+ {
+ return;
+ }
+
// Listen on "LLApp", and when the app is shutting down, close the queue
// and join the workers.
LLEventPumps::instance().obtain("LLApp").listen(