From b504c692554d492113a10ef45427fe0ab0d8a85d Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 13 Jan 2022 12:55:53 -0800 Subject: SL-16606: Add profiler category THREAD --- indra/llcommon/llthreadsafequeue.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'indra/llcommon/llthreadsafequeue.h') diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 2806506550..68d79cdd12 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -275,7 +275,7 @@ template template bool LLThreadSafeQueue::tryLock(CALLABLE&& callable) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock1(mLock, std::defer_lock); if (!lock1.try_lock()) return false; @@ -292,7 +292,7 @@ bool LLThreadSafeQueue::tryLockUntil( const std::chrono::time_point& until, CALLABLE&& callable) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock1(mLock, std::defer_lock); if (!lock1.try_lock_until(until)) return false; @@ -306,7 +306,7 @@ template template bool LLThreadSafeQueue::push_(lock_t& lock, T&& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; if (mStorage.size() >= mCapacity) return false; @@ -322,7 +322,7 @@ template template bool LLThreadSafeQueue::pushIfOpen(T&& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock1(mLock); while (true) { @@ -345,7 +345,7 @@ template template void LLThreadSafeQueue::push(T&& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; if (! pushIfOpen(std::forward(element))) { LLTHROW(LLThreadSafeQueueInterrupt()); @@ -357,7 +357,7 @@ template template bool LLThreadSafeQueue::tryPush(T&& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; return tryLock( [this, element=std::move(element)](lock_t& lock) { @@ -374,7 +374,7 @@ bool LLThreadSafeQueue::tryPushFor( const std::chrono::duration& timeout, T&& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; // Convert duration to time_point: passing the same timeout duration to // each of multiple calls is wrong. return tryPushUntil(std::chrono::steady_clock::now() + timeout, @@ -388,7 +388,7 @@ bool LLThreadSafeQueue::tryPushUntil( const std::chrono::time_point& until, T&& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; return tryLockUntil( until, [this, until, element=std::move(element)](lock_t& lock) @@ -421,7 +421,7 @@ template typename LLThreadSafeQueue::pop_result LLThreadSafeQueue::pop_(lock_t& lock, ElementT& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; // If mStorage is empty, there's no head element. if (mStorage.empty()) return mClosed? DONE : EMPTY; @@ -443,7 +443,7 @@ LLThreadSafeQueue::pop_(lock_t& lock, ElementT& element) template ElementT LLThreadSafeQueue::pop(void) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock1(mLock); ElementT value; while (true) @@ -472,7 +472,7 @@ ElementT LLThreadSafeQueue::pop(void) template bool LLThreadSafeQueue::tryPop(ElementT & element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; return tryLock( [this, &element](lock_t& lock) { @@ -490,7 +490,7 @@ bool LLThreadSafeQueue::tryPopFor( const std::chrono::duration& timeout, ElementT& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; // Convert duration to time_point: passing the same timeout duration to // each of multiple calls is wrong. return tryPopUntil(std::chrono::steady_clock::now() + timeout, element); @@ -503,7 +503,7 @@ bool LLThreadSafeQueue::tryPopUntil( const std::chrono::time_point& until, ElementT& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; return tryLockUntil( until, [this, until, &element](lock_t& lock) @@ -523,7 +523,7 @@ LLThreadSafeQueue::tryPopUntil_( const std::chrono::time_point& until, ElementT& element) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; while (true) { pop_result popped = pop_(lock, element); @@ -550,7 +550,7 @@ LLThreadSafeQueue::tryPopUntil_( template size_t LLThreadSafeQueue::size(void) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock(mLock); return mStorage.size(); } @@ -559,7 +559,7 @@ size_t LLThreadSafeQueue::size(void) template void LLThreadSafeQueue::close() { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock(mLock); mClosed = true; lock.unlock(); @@ -573,7 +573,7 @@ void LLThreadSafeQueue::close() template bool LLThreadSafeQueue::isClosed() { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock(mLock); return mClosed; } @@ -582,7 +582,7 @@ bool LLThreadSafeQueue::isClosed() template bool LLThreadSafeQueue::done() { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; lock_t lock(mLock); return mClosed && mStorage.empty(); } -- cgit v1.2.3