summaryrefslogtreecommitdiff
path: root/indra/llimage/llimageworker.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-12-15 18:26:14 +0100
committerGuru <alexandrgproductengine@lindenlab.com>2023-12-21 19:12:52 +0100
commit74c8b028d42a8c5b080bb861e427f38cedd4ad7c (patch)
tree067f8e85fd7b4f91903ad2aa32630b7dd0364099 /indra/llimage/llimageworker.cpp
parente104f7ce0291ed1f7ab170714e319408bf076221 (diff)
SL-20743 Use LLMutex in LLImageBase for internal data thread-safety
Diffstat (limited to 'indra/llimage/llimageworker.cpp')
-rw-r--r--indra/llimage/llimageworker.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index c1ee052997..44749343e1 100644
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -149,9 +149,18 @@ ImageRequest::~ImageRequest()
bool ImageRequest::processRequest()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
+
+ if (mFormattedImage.isNull())
+ return true;
+
const F32 decode_time_slice = 0.f; //disable time slicing
bool done = true;
- if (!mDecodedRaw && mFormattedImage.notNull())
+
+ LLImageDataLock lockFormatted(mFormattedImage);
+ LLImageDataLock lockDecodedRaw(mDecodedImageRaw);
+ LLImageDataLock lockDecodedAux(mDecodedImageAux);
+
+ if (!mDecodedRaw)
{
// Decode primary channels
if (mDecodedImageRaw.isNull())
@@ -177,7 +186,7 @@ bool ImageRequest::processRequest()
// some decoders are removing data when task is complete and there were errors
mDecodedRaw = done && mDecodedImageRaw->getData();
}
- if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull())
+ if (done && mNeedsAux && !mDecodedAux)
{
// Decode aux channel
if (!mDecodedImageAux)