summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-02-22 15:23:14 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-02-22 15:23:14 +0200
commit481713000b4b45f2ce6d397aa3326520bbb9da16 (patch)
treea3c9d68a920770773b8ff6a62200cca6b0746ec9 /indra/llcommon
parent7e0bbc79ea0237c59b38e78b66f1fee3ca289258 (diff)
MAINT-8183 Fixed some exit issues and crashes
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llthread.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 32e8ea9682..1f4aa9b3a6 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -152,13 +152,16 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
//LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
- // We're done with the run function, this thread is done executing now.
- //NB: we are using this flag to sync across threads...we really need memory barriers here
- threadp->mStatus = STOPPED;
delete threadp->mRecorder;
threadp->mRecorder = NULL;
+ // We're done with the run function, this thread is done executing now.
+ //NB: we are using this flag to sync across threads...we really need memory barriers here
+ // Todo: add LLMutex per thread instead of flag?
+ // We are using "while (mStatus != STOPPED) {ms_sleep();}" everywhere.
+ threadp->mStatus = STOPPED;
+
return NULL;
}