summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthread.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <118752495+marchcat@users.noreply.github.com>2026-08-13 20:18:46 +0300
committerGitHub <noreply@github.com>2026-08-13 20:18:46 +0300
commit039c1b4b027a5f34449a934d9aea0cea8a2c7659 (patch)
treef27a36ca21ab04d7e3ddb0c65ea39ee063252611 /indra/llcommon/llthread.cpp
parentc8730531ee1a030c4e71f2b7ddb7d3394c9af7b7 (diff)
parentf376c52ee2a22b3b58263d86566394e80626fc1a (diff)
Merge pull request #6133 from secondlife/marchcat/lua-linux-develop
geenz/linux-to-develop to lua_editor
Diffstat (limited to 'indra/llcommon/llthread.cpp')
-rw-r--r--indra/llcommon/llthread.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index bae80a3fb9..277edcb6a2 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -310,11 +310,13 @@ void LLThread::shutdown()
// The thread isn't already stopped
// First, set the flag that indicates that we're ready to die
setQuitting();
+ if (!isStopped())
+ {
+ // Give the thread a chance to update status.
+ yield();
+ }
//LL_INFOS() << "LLThread::~LLThread() Killing thread " << mName << " Status: " << mStatus << LL_ENDL;
- // Now wait a bit for the thread to exit
- // It's unclear whether I should even bother doing this - this destructor
- // should never get called unless we're already stopped, really...
S32 counter = 0;
const S32 MAX_WAIT = 600;
while (counter < MAX_WAIT)
@@ -323,9 +325,9 @@ void LLThread::shutdown()
{
break;
}
- // Sleep for a tenth of a second
- ms_sleep(100);
- yield();
+ // Sleep for 10ms, 6 seconds total, then give up and kill the thread
+ // Warning: This can be called from the main thread
+ ms_sleep(10);
counter++;
}
}