From 9117a37c3d1bd9741e599b60fdf000f9f174f72a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 31 Oct 2024 02:30:54 +0200 Subject: Give control over thread queue's automatic shutdown --- indra/llcommon/workqueue.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/workqueue.h') diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h index 9d7bbfbf7a..d424ca6e1c 100644 --- a/indra/llcommon/workqueue.h +++ b/indra/llcommon/workqueue.h @@ -51,7 +51,7 @@ namespace LL * You may omit the WorkQueueBase name, in which case a unique name is * synthesized; for practical purposes that makes it anonymous. */ - WorkQueueBase(const std::string& name); + WorkQueueBase(const std::string& name, bool auto_shutdown); /** * Since the point of WorkQueue is to pass work to some other worker @@ -212,7 +212,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(), size_t capacity=1024); + WorkQueue(const std::string& name = std::string(), size_t capacity=1024, bool auto_shutdown = true); /** * Since the point of WorkQueue is to pass work to some other worker @@ -282,7 +282,7 @@ namespace LL * You may omit the WorkSchedule name, in which case a unique name is * synthesized; for practical purposes that makes it anonymous. */ - WorkSchedule(const std::string& name = std::string(), size_t capacity=1024); + WorkSchedule(const std::string& name = std::string(), size_t capacity=1024, bool auto_shutdown = true); /** * Since the point of WorkSchedule is to pass work to some other worker -- cgit v1.2.3 From ec6c988bbbc59aed218d3629bf0c13192f6b726c Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 23 Apr 2025 01:27:32 +0300 Subject: #3918 Implement automatic shutdown for WorkQueueBase --- indra/llcommon/workqueue.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llcommon/workqueue.h') diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h index d424ca6e1c..735ad38a26 100644 --- a/indra/llcommon/workqueue.h +++ b/indra/llcommon/workqueue.h @@ -53,6 +53,8 @@ namespace LL */ WorkQueueBase(const std::string& name, bool auto_shutdown); + virtual ~WorkQueueBase(); + /** * Since the point of WorkQueue is to pass work to some other worker * thread(s) asynchronously, it's important that it continue to exist @@ -197,6 +199,9 @@ namespace LL private: virtual Work pop_() = 0; virtual bool tryPop_(Work&) = 0; + + // Name used for the LLApp event listener (empty if not registered) + std::string mListenerName; }; /***************************************************************************** -- cgit v1.2.3