diff options
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 17 |
1 files changed, 16 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() |