diff options
author | Nicolas Roard <nicolas@android.com> | 2011-01-20 13:19:34 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-20 13:19:34 -0800 |
commit | d60905195ba2f0052976c6c92839a1bcaf3a7387 (patch) | |
tree | 039befd1dad4ba5e3e37efa3ce05a9b13f37f5f0 /WebCore | |
parent | 686b4616074df77cc94f6801e6620255531ef6c9 (diff) | |
parent | c14a572a92d263e1cd2152532858f9092adcb51c (diff) | |
download | external_webkit-d60905195ba2f0052976c6c92839a1bcaf3a7387.zip external_webkit-d60905195ba2f0052976c6c92839a1bcaf3a7387.tar.gz external_webkit-d60905195ba2f0052976c6c92839a1bcaf3a7387.tar.bz2 |
Merge "Fix deadlock in textures generator" into honeycomb
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/platform/graphics/android/TexturesGenerator.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/WebCore/platform/graphics/android/TexturesGenerator.cpp b/WebCore/platform/graphics/android/TexturesGenerator.cpp index 62cadc3..cdf4b5a 100644 --- a/WebCore/platform/graphics/android/TexturesGenerator.cpp +++ b/WebCore/platform/graphics/android/TexturesGenerator.cpp @@ -106,20 +106,19 @@ void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter) m_waitForCompletion = true; mRequestedOperationsLock.unlock(); - delete filter; - if (!m_waitForCompletion) - return; + delete filter; - // At this point, it means that we are currently executing an operation that - // we want to be removed -- we should wait until it is done, so that - // when we return our caller can be sure that there is no more operations - // in the queue matching the given filter. mRequestedOperationsLock.lock(); if (!m_waitForCompletion) { mRequestedOperationsLock.unlock(); return; // operation treated } + + // At this point, it means that we are currently executing an operation that + // we want to be removed -- we should wait until it is done, so that + // when we return our caller can be sure that there is no more operations + // in the queue matching the given filter. mRequestedOperationsCond.wait(mRequestedOperationsLock); m_waitForCompletion = false; mRequestedOperationsLock.unlock(); @@ -179,8 +178,10 @@ bool TexturesGenerator::threadLoop() } if (!mRequestedOperations.size()) stop = true; - if (m_waitForCompletion) + if (m_waitForCompletion) { mRequestedOperationsCond.signal(); + m_waitForCompletion = false; + } mRequestedOperationsLock.unlock(); } |