diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-10-24 12:54:38 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2020-03-25 19:02:24 -0400 |
commit | cbf146f2b3fc255bc83f2b01101dc29658bea6ea (patch) | |
tree | da7bc386376e825eda480dc166495434543d5fcd /indra/llmessage | |
parent | 7541e784d991888d6f600f4cb9439d5fcf15e452 (diff) |
DRTVWR-476: Pump coroutines a few more times when we start quitting.
By the time "LLApp" listeners are notified that the app is quitting, the
mainloop is no longer running. Even though those listeners do things like
close work queues and inject exceptions into pending promises, any coroutines
waiting on those resources must regain control before they can notice and shut
down properly. Add a final "LLApp" listener that resumes ready coroutines a
few more times.
Make sure every other "LLApp" listener is positioned before that new one.
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llcoproceduremanager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index a8f6b8aa67..a71a31bfd2 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -218,8 +218,9 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() { - // store in our LLTempBoundListener so that when the LLCoprocedurePool is - // destroyed, we implicitly disconnect from this LLEventPump + // Store in our LLTempBoundListener so that when the LLCoprocedurePool is + // destroyed, we implicitly disconnect from this LLEventPump. + // Run this listener before the "final" listener. mStatusListener = LLEventPumps::instance().obtain("LLApp").listen( poolName, [this, poolName](const LLSD& status) @@ -235,7 +236,9 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mPendingCoprocs.close(); } return false; - }); + }, + LLEventPump::NameList{}, // after + LLEventPump::NameList{ "final "}); // before for (size_t count = 0; count < mPoolSize; ++count) { |