summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-03-01 16:37:59 -0500
committerGitHub <noreply@github.com>2025-03-01 16:37:59 -0500
commit5d78ff48cb1f916180a2ffd10989eae50b81b4ec (patch)
treeeb1f22ba21082efbb023b1b85468ed7923d519fb /indra/newview/lltexturefetch.cpp
parent5aa359ed8d4d36e45c562cf56cb69580dc4236b4 (diff)
parent42ceac9695f7e098f15264977396a939c8ddfd23 (diff)
Merge pull request #3634 from secondlife/release/2024.12-ForeverFPS
Update develop with 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.