diff options
| author | Xiaohong Bao <bao@lindenlab.com> | 2012-04-12 15:50:25 -0600 |
|---|---|---|
| committer | Xiaohong Bao <bao@lindenlab.com> | 2012-04-12 15:50:25 -0600 |
| commit | 0a42495906fdc56eeb118ac41ffa9ebcadc8de17 (patch) | |
| tree | 5906d53ff8d0ca460d98a678fd730d9e4ba33944 /indra/newview/lltexturefetch.cpp | |
| parent | 3c0e4e432461122ed9efe3bb6157247a34d7911b (diff) | |
for SH-3074: clear ghost and stale texture fetching requests in time
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
| -rwxr-xr-x | indra/newview/lltexturefetch.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9ed6537b7a..3d8424e274 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -845,6 +845,8 @@ void LLTextureFetchWorker::startWork(S32 param) // Called from LLWorkerThread::processRequest() bool LLTextureFetchWorker::doWork(S32 param) { + static const F32 FETCHING_TIMEOUT = 120.f;//seconds + LLMutexLock lock(&mWorkMutex); if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) @@ -1187,6 +1189,8 @@ bool LLTextureFetchWorker::doWork(S32 param) bool res = false; if (!mUrl.empty()) { + mRequestedTimer.reset(); + mLoaded = FALSE; mGetStatus = 0; mGetReason.clear(); @@ -1345,6 +1349,13 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { + if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) + { + //timeout, abort. + mState = DONE; + return true; + } + setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); return false; } |
