Avoid dead lock in LLQueuedThread::generateHandle / LLTextureFetchWorker::callbackDecoded
Thead 1:
indra/llcommon/llqueuedthread.cpp:456:
452 if (complete)
453 {
454 lockData(); // This locks LLThread::mRunCondition
455 req->setStatus(STATUS_COMPLETE);
456 req->finishRequest(true);
LLImageDecodeThread::ImageRequest::finishRequest calls:
mResponder->completed(success, mDecodedImageRaw, mDecodedImageAux);
LLTextureFetchWorker::DecodeResponder::completed calls:
worker->callbackDecoded(success, raw, aux);
LLTextureFetchWorker::callbackDecoded calls:
LLMutexLock lock(&mWorkMutex); // This locks LLTextureFetchWorker::mWorkMutex
Thread 2:
LLTextureFetchWorker::doWork calls:
LLMutexLock lock(&mWorkMutex); // This locks LLTextureFetchWorker::mWorkMutex
.
.
.
mDecodeHandle = mFetcher->mImageDecodeThread->decodeImage(mFormattedImage, image_priority, discard, mNeedsAux, new DecodeResponder(mFetcher, mID, this));
LLImageDecodeThread::decodeImage calls:
handle_t handle = generateHandle();
LLQueuedThread::generateHandle calls:
lockData(); // This locks LLThread::mRunCondition
This commit is contained in:
@@ -175,7 +175,7 @@ BOOL LLVFile::isReadComplete()
|
||||
{
|
||||
LLVFSThread::Request* req = (LLVFSThread::Request*)sVFSThread->getRequest(mHandle);
|
||||
LLVFSThread::status_t status = req->getStatus();
|
||||
if (status == LLVFSThread::STATUS_COMPLETE)
|
||||
if (status == LLVFSThread::STATUS_COMPLETE && !(req->getFlags() & LLVFSThread::FLAG_LOCKED))
|
||||
{
|
||||
mBytesRead = req->getBytesRead();
|
||||
mPosition += mBytesRead;
|
||||
|
||||
Reference in New Issue
Block a user