summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-07-19 23:27:00 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-07-19 23:38:31 +0300
commita6ea2dbedcf54b6a847d894b77777cc88698a28d (patch)
tree21b1ce41bd38fc208c13aea1e969746dacf2bfb6 /indra/llcommon
parent2d855a9fd7ea0ef32f8d9de81b2532b3771142e4 (diff)
SL-15292 Voice's singleton shutdown before voice's coroutine
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llcoros.cpp9
-rw-r--r--indra/llcommon/llcoros.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index 23419a52a7..7ad10f206e 100644
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -131,6 +131,13 @@ LLCoros::LLCoros():
LLCoros::~LLCoros()
{
+}
+
+void LLCoros::cleanupSingleton()
+{
+ // Some of the coroutines (like voice) will depend onto
+ // origin singletons, so clean coros before deleting those
+
printActiveCoroutines("at entry to ~LLCoros()");
// Other LLApp status-change listeners do things like close
// work queues and inject the Stop exception into pending
@@ -146,6 +153,8 @@ LLCoros::~LLCoros()
{
// don't use llcoro::suspend() because that module depends
// on this one
+ // This will yield current(main) thread and will let active
+ // corutines run once
boost::this_fiber::yield();
}
printActiveCoroutines("after pumping");
diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h
index 38c2356c99..51f7380def 100644
--- a/indra/llcommon/llcoros.h
+++ b/indra/llcommon/llcoros.h
@@ -89,6 +89,8 @@ class LL_COMMON_API LLCoros: public LLSingleton<LLCoros>
{
LLSINGLETON(LLCoros);
~LLCoros();
+
+ void cleanupSingleton();
public:
/// The viewer's use of the term "coroutine" became deeply embedded before
/// the industry term "fiber" emerged to distinguish userland threads from