diff options
| author | Monty Brandenberg <monty@lindenlab.com> | 2012-07-17 11:24:52 -0400 | 
|---|---|---|
| committer | Monty Brandenberg <monty@lindenlab.com> | 2012-07-17 11:24:52 -0400 | 
| commit | c9f5bc7cae793b6965ceb9490243b4c52017c254 (patch) | |
| tree | 36413a3dc37accfac02e1c9ace9bb28da50f99a3 | |
| parent | 8d3e5f3959b071226c4a5c2c68d9fe8664ae1ffd (diff) | |
SH-3189 Improve naive data structures
Move releaseHttpWaiters() to commonUpdate from doWork.
More appropriate home for it.  Have deleteOK() defer deletion
of anything in WAIT_HTTP_RESOURCE2 state to keep pointers valid
for the releaseHttpWaiters() method.  It will then transition
canceled operations to SEND_HTTP_REQ where they can be deleted.
| -rwxr-xr-x | indra/newview/lltexturefetch.cpp | 14 | 
1 files changed, 11 insertions, 3 deletions
| diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 225ea46558..51d57ccf68 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1064,9 +1064,6 @@ bool LLTextureFetchWorker::doWork(S32 param)  	static const LLCore::HttpStatus http_service_unavail(HTTP_SERVICE_UNAVAILABLE);		// 503  	static const LLCore::HttpStatus http_not_sat(HTTP_REQUESTED_RANGE_NOT_SATISFIABLE);	// 416; -	// Release waiters while we aren't holding the Mw lock. -	mFetcher->releaseHttpWaiters(); -	  	LLMutexLock lock(&mWorkMutex);										// +Mw  	if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) @@ -1927,6 +1924,14 @@ bool LLTextureFetchWorker::deleteOK()  		// and will dereference it to do notification.  		delete_ok = false;  	} + +	if (WAIT_HTTP_RESOURCE2 == mState) +	{ +		// Don't delete the worker out from under the +		// releaseHttpWaiters() method.  Keep the pointers +		// valid, clean up after transition. +		delete_ok = false; +	}  	// Allow any pending reads or writes to complete  	if (mCacheReadHandle != LLTextureCache::nullHandle()) @@ -2737,6 +2742,9 @@ bool LLTextureFetch::runCondition()  // Threads:  Ttf  void LLTextureFetch::commonUpdate()  { +	// Release waiters +	releaseHttpWaiters(); +	  	// Run a cross-thread command, if any.  	cmdDoWork(); | 
