summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthread.cpp
diff options
context:
space:
mode:
authornat-goodspeed <nat@lindenlab.com>2024-09-05 15:40:12 -0400
committerGitHub <noreply@github.com>2024-09-05 15:40:12 -0400
commit04568da18d2261f3f7b851cf5341b766c9648204 (patch)
tree83d5db1c173636bb77ebb33e860fac77ab5d79e8 /indra/llcommon/llthread.cpp
parent18d81e20f0b0044c16615953d7b69d7fb34d3449 (diff)
parentff2d79906ccef217194d5d9ec9d7025db03592a8 (diff)
Merge pull request #2513 from secondlife/lua-merge-dev
Merge develop branch into Lua project branch.
Diffstat (limited to 'indra/llcommon/llthread.cpp')
-rw-r--r--indra/llcommon/llthread.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index faaaefd561..e5d25b52f0 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -269,6 +269,7 @@ void LLThread::shutdown()
mStatus = STOPPED;
return;
}
+ delete mThreadp;
mThreadp = NULL;
}
@@ -299,6 +300,7 @@ void LLThread::start()
{
mThreadp = new std::thread(std::bind(&LLThread::threadRun, this));
mNativeHandle = mThreadp->native_handle();
+ mThreadp->detach();
}
catch (std::system_error& ex)
{
@@ -344,7 +346,7 @@ bool LLThread::runCondition(void)
// Stop thread execution if requested until unpaused.
void LLThread::checkPause()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->lock();
// This is in a while loop because the pthread API allows for spurious wakeups.
@@ -376,20 +378,20 @@ void LLThread::setQuitting()
// static
LLThread::id_t LLThread::currentID()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
return std::this_thread::get_id();
}
// static
void LLThread::yield()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
std::this_thread::yield();
}
void LLThread::wake()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->lock();
if(!shouldSleep())
{
@@ -400,7 +402,7 @@ void LLThread::wake()
void LLThread::wakeLocked()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if(!shouldSleep())
{
mRunCondition->signal();
@@ -409,13 +411,13 @@ void LLThread::wakeLocked()
void LLThread::lockData()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->lock();
}
void LLThread::unlockData()
{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->unlock();
}