diff options
author | Armin Weatherwax | 2010-03-02 14:40:59 +0100 |
---|---|---|
committer | Armin Weatherwax | 2010-03-04 22:36:51 +0100 |
commit | 35c5041b506c959e455e67fab837cf6b99e5a2d0 (patch) | |
tree | 933e6b6ccedaba5930975c636425005a277ddf93 /linden/indra/llcommon/llthread.cpp | |
parent | Vex Streeter, Merov Linden: SNOW-434 Unsafe threaded op. (lltexturefetch.cpp). (diff) | |
download | meta-impy-35c5041b506c959e455e67fab837cf6b99e5a2d0.zip meta-impy-35c5041b506c959e455e67fab837cf6b99e5a2d0.tar.gz meta-impy-35c5041b506c959e455e67fab837cf6b99e5a2d0.tar.bz2 meta-impy-35c5041b506c959e455e67fab837cf6b99e5a2d0.tar.xz |
Robin Cornelius, Aleric Inglewood: SNOW-196 missing mutexes for texture fetch
Applys a trylock() abort system to allow the worker thread to avoid deadlocks
due to a race between mQueueMutex and mWorkerMutex.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llcommon/llthread.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/linden/indra/llcommon/llthread.cpp b/linden/indra/llcommon/llthread.cpp index b39ffb6..60ccd5c 100644 --- a/linden/indra/llcommon/llthread.cpp +++ b/linden/indra/llcommon/llthread.cpp | |||
@@ -322,6 +322,17 @@ bool LLMutex::isLocked() | |||
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
325 | //trys to grab a lock and if sucessful returns true | ||
326 | bool LLMutex::tryLock() | ||
327 | { | ||
328 | apr_status_t status = apr_thread_mutex_trylock(mAPRMutexp); | ||
329 | if (APR_STATUS_IS_EBUSY(status)) | ||
330 | { | ||
331 | return false; | ||
332 | } | ||
333 | return true; | ||
334 | } | ||
335 | |||
325 | //============================================================================ | 336 | //============================================================================ |
326 | 337 | ||
327 | LLCondition::LLCondition(apr_pool_t *poolp) : | 338 | LLCondition::LLCondition(apr_pool_t *poolp) : |