diff options
author | Grace Kloba <klobag@google.com> | 2009-10-30 08:03:12 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-30 08:03:12 -0700 |
commit | 1e9e2ea3ae5ef732b6cb90aa16f94b43cbde5f21 (patch) | |
tree | 763f7525fc3c8ae32947c459b1560c54ffda8426 /JavaScriptCore/wtf | |
parent | 84191aa5bc11de486d662f98d4d618b179ca45ca (diff) | |
parent | 5469794fd9ad86cd03ba4cf7ef0bc82329362f39 (diff) | |
download | external_webkit-1e9e2ea3ae5ef732b6cb90aa16f94b43cbde5f21.zip external_webkit-1e9e2ea3ae5ef732b6cb90aa16f94b43cbde5f21.tar.gz external_webkit-1e9e2ea3ae5ef732b6cb90aa16f94b43cbde5f21.tar.bz2 |
am 5469794f: Avoid constructing the MutexLocker class to avoid two mystery crashes.
Merge commit '5469794fd9ad86cd03ba4cf7ef0bc82329362f39' into eclair-mr2
* commit '5469794fd9ad86cd03ba4cf7ef0bc82329362f39':
Avoid constructing the MutexLocker class to avoid
Diffstat (limited to 'JavaScriptCore/wtf')
-rw-r--r-- | JavaScriptCore/wtf/Threading.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/JavaScriptCore/wtf/Threading.h b/JavaScriptCore/wtf/Threading.h index c5e8f2f..00d34f2 100644 --- a/JavaScriptCore/wtf/Threading.h +++ b/JavaScriptCore/wtf/Threading.h @@ -259,8 +259,15 @@ public: #if USE(LOCKFREE_THREADSAFESHARED) atomicIncrement(&m_refCount); #else +#if defined ANDROID // avoid constructing a class to avoid two mystery crashes + m_mutex.lock(); +#else MutexLocker locker(m_mutex); +#endif ++m_refCount; +#if defined ANDROID + m_mutex.unlock(); +#endif #endif } @@ -287,9 +294,16 @@ protected: #else int refCount; { +#if defined ANDROID // avoid constructing a class to avoid two mystery crashes + m_mutex.lock(); +#else MutexLocker locker(m_mutex); +#endif --m_refCount; refCount = m_refCount; +#if defined ANDROID + m_mutex.unlock(); +#endif } if (refCount <= 0) return true; |