summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-03-07 16:44:21 +0800
committerErik Kundiman <erik@megapahit.org>2025-03-07 16:44:21 +0800
commit266e96605781960799dc5388cc1ac168432ff106 (patch)
tree5f46ae7d39a8a954ea9f79dc7216cad6aca2ee6a /indra/newview/lltexturefetch.cpp
parent530ff898b00d1759ab4abb32dcf9767960ce7170 (diff)
parentbf949ce004c25917aabddd1cd24be812713e4602 (diff)
Merge branch '2024.12-ForeverFPS'
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r--indra/newview/lltexturefetch.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index bac0c736b1..087761cbd0 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -29,6 +29,7 @@
#include <iostream>
#include <map>
#include <algorithm>
+#include <atomic>
#include "lltexturefetch.h"
@@ -2843,7 +2844,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, S3
bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority)
{
LL_PROFILE_ZONE_SCOPED;
- mRequestQueue.tryPost([=]()
+ mRequestQueue.tryPost([=, this]()
{
LLTextureFetchWorker* worker = getWorker(id);
if (worker)
@@ -3571,29 +3572,30 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
//if (! gViewerAssetStatsThread1)
// return true;
- static volatile bool reporting_started(false);
- static volatile S32 report_sequence(0);
+ static std::atomic<bool> reporting_started(false);
+ static std::atomic<S32> report_sequence(0);
// In mStatsSD, we have a copy we own of the LLSD representation
// of the asset stats. Add some additional fields and ship it off.
static const S32 metrics_data_version = 2;
- bool initial_report = !reporting_started;
+ bool initial_report = !reporting_started.load();
mStatsSD["session_id"] = mSessionID;
mStatsSD["agent_id"] = mAgentID;
mStatsSD["message"] = "ViewerAssetMetrics";
- mStatsSD["sequence"] = report_sequence;
+ mStatsSD["sequence"] = report_sequence.load();
mStatsSD["initial"] = initial_report;
mStatsSD["version"] = metrics_data_version;
mStatsSD["break"] = static_cast<bool>(LLTextureFetch::svMetricsDataBreak);
// Update sequence number
- if (S32_MAX == ++report_sequence)
+ if (S32_MAX == report_sequence.fetch_add(1))
{
- report_sequence = 0;
+ report_sequence.store(0);
}
- reporting_started = true;
+
+ reporting_started.store(true);
// Limit the size of the stats report if necessary.