diff options
Diffstat (limited to 'indra/llcommon/workqueue.cpp')
-rw-r--r-- | indra/llcommon/workqueue.cpp | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp index 0eb20323ad..c8ece616b2 100644 --- a/indra/llcommon/workqueue.cpp +++ b/indra/llcommon/workqueue.cpp @@ -21,7 +21,6 @@ #include "llcoros.h" #include LLCOROS_MUTEX_HEADER #include "llerror.h" -#include "llevents.h" #include "llexception.h" #include "stringize.h" @@ -31,38 +30,11 @@ using Lock = LLCoros::LockType; /***************************************************************************** * WorkQueueBase *****************************************************************************/ -LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown) - : super(makeName(name)) +LL::WorkQueueBase::WorkQueueBase(const std::string& name): + super(makeName(name)) { - if (auto_shutdown) - { - // Register for "LLApp" events so we can implicitly close() on viewer shutdown - std::string listener_name = "WorkQueue:" + getKey(); - LLEventPumps::instance().obtain("LLApp").listen( - listener_name, - [this](const LLSD& stat) - { - std::string status(stat["status"]); - if (status != "running") - { - // Viewer is shutting down, close this queue - LL_DEBUGS("WorkQueue") << getKey() << " closing on app shutdown" << LL_ENDL; - close(); - } - return false; - }); - - // Store the listener name so we can unregister in the destructor - mListenerName = listener_name; - } -} - -LL::WorkQueueBase::~WorkQueueBase() -{ - if (!mListenerName.empty() && !LLEventPumps::wasDeleted()) - { - LLEventPumps::instance().obtain("LLApp").stopListening(mListenerName); - } + // TODO: register for "LLApp" events so we can implicitly close() on + // viewer shutdown. } void LL::WorkQueueBase::runUntilClose() @@ -240,8 +212,8 @@ void LL::WorkQueueBase::checkCoroutine(const std::string& method) /***************************************************************************** * WorkQueue *****************************************************************************/ -LL::WorkQueue::WorkQueue(const std::string& name, size_t capacity, bool auto_shutdown): - super(name, auto_shutdown), +LL::WorkQueue::WorkQueue(const std::string& name, size_t capacity): + super(name), mQueue(capacity) { } @@ -289,8 +261,8 @@ bool LL::WorkQueue::tryPop_(Work& work) /***************************************************************************** * WorkSchedule *****************************************************************************/ -LL::WorkSchedule::WorkSchedule(const std::string& name, size_t capacity, bool auto_shutdown): - super(name, auto_shutdown), +LL::WorkSchedule::WorkSchedule(const std::string& name, size_t capacity): + super(name), mQueue(capacity) { } |