From cee348256937cd187bdd0e29eee2154651453817 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 22 Sep 2021 19:35:39 -0700 Subject: [PATCH] SL-16028: Add Tracy markup to LLThread --- indra/llcommon/llthread.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index a8cc750437..b40db9597f 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -148,7 +148,9 @@ void LLThread::threadRun() { try { + LL_PROFILER_THREAD_BEGIN run(); + LL_PROFILER_THREAD_END } catch (const LLContinueError &e) { @@ -333,6 +335,8 @@ bool LLThread::runCondition(void) // Stop thread execution if requested until unpaused. void LLThread::checkPause() { + LL_PROFILER_THREAD_BEGIN + mDataLock->lock(); // This is in a while loop because the pthread API allows for spurious wakeups. @@ -345,6 +349,8 @@ void LLThread::checkPause() } mDataLock->unlock(); + + LL_PROFILER_THREAD_END } //============================================================================ @@ -375,12 +381,16 @@ void LLThread::yield() void LLThread::wake() { + LL_PROFILER_THREAD_BEGIN + mDataLock->lock(); if(!shouldSleep()) { mRunCondition->signal(); } mDataLock->unlock(); + + LL_PROFILER_THREAD_END } void LLThread::wakeLocked()