summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-11-01 19:38:55 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-11-01 19:38:55 +0200
commit3faba7515c757ca3183522bd017c0f76d9c4581c (patch)
tree07fb21fcea3a36d5763fc1ecd0acbb08bdbe74e8 /indra/llrender
parent2369af6999e65d523ff4db06e7d5fda792153bee (diff)
SL-16237 FIXED Viewer hangs on login
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp17
-rw-r--r--indra/llrender/llimagegl.h2
2 files changed, 18 insertions, 1 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 09b1c71f02..cbc5392882 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -2288,7 +2288,10 @@ bool LLImageGLThread::postCallback(const std::function<void()>& callback)
{
try
{
- mCallbackQueue.post(callback);
+ if (!mCallbackQueue.tryPost(callback))
+ {
+ mPendingCallbackQ.push(callback);
+ }
}
catch (LLThreadSafeQueueInterrupt e)
{
@@ -2304,6 +2307,18 @@ void LLImageGLThread::executeCallbacks()
LL_PROFILE_ZONE_SCOPED;
//executed from main thread
mCallbackQueue.runPending();
+
+ while (!mPendingCallbackQ.empty())
+ {
+ if (mCallbackQueue.tryPost(mPendingCallbackQ.front()))
+ {
+ mPendingCallbackQ.pop();
+ }
+ else
+ {
+ break;
+ }
+ }
}
void LLImageGLThread::run()
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 95b60bd0bd..8264e4a5f2 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -332,6 +332,8 @@ public:
void* mContext;
LLAtomicBool mFinished;
+ std::queue<std::function<void()>> mPendingCallbackQ;
+
static LLImageGLThread* sInstance;
};