diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/threadpool.cpp | 4 | ||||
-rw-r--r-- | indra/llcommon/threadpool.h | 2 | ||||
-rw-r--r-- | indra/llcommon/workqueue.cpp | 5 | ||||
-rw-r--r-- | indra/llcommon/workqueue.h | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index 1899f9a20a..e4fa0eccf3 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -21,8 +21,8 @@ #include "llevents.h" #include "stringize.h" -LL::ThreadPool::ThreadPool(const std::string& name, size_t threads): - mQueue(name), +LL::ThreadPool::ThreadPool(const std::string& name, size_t threads, size_t capacity): + mQueue(name, capacity), mName("ThreadPool:" + name) { for (size_t i = 0; i < threads; ++i) diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index 8f3c8514b5..6e3858508b 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -29,7 +29,7 @@ namespace LL * Pass ThreadPool a string name. This can be used to look up the * relevant WorkQueue. */ - ThreadPool(const std::string& name, size_t threads=1); + ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024); ~ThreadPool(); void close(); diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp index 9808757b0a..14ae4c4ab8 100644 --- a/indra/llcommon/workqueue.cpp +++ b/indra/llcommon/workqueue.cpp @@ -26,8 +26,9 @@ using Mutex = LLCoros::Mutex; using Lock = LLCoros::LockType; -LL::WorkQueue::WorkQueue(const std::string& name): - super(makeName(name)) +LL::WorkQueue::WorkQueue(const std::string& name, size_t capacity): + super(makeName(name)), + mQueue(capacity) { // TODO: register for "LLApp" events so we can implicitly close() on // viewer shutdown. diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h index d0e3f870fe..5987883829 100644 --- a/indra/llcommon/workqueue.h +++ b/indra/llcommon/workqueue.h @@ -54,7 +54,7 @@ namespace LL * You may omit the WorkQueue name, in which case a unique name is * synthesized; for practical purposes that makes it anonymous. */ - WorkQueue(const std::string& name = std::string()); + WorkQueue(const std::string& name = std::string(), size_t capacity=1024); /** * Since the point of WorkQueue is to pass work to some other worker |