diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 11:52:57 +1000 |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 11:52:57 +1000 |
commit | aa9cf406d62004519ad54596e1c391f9a6439210 (patch) | |
tree | dd562b9c296981f2761b76623911be8496c7af84 /src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp | |
parent | 987aec28b950e1c9817a20a9dd71afc071cd93ea (diff) | |
parent | 56b6a5924008ab5cdbae36e9662eddba923acd5e (diff) |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp index 7ece5da3d..8f056c817 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSLock.cpp @@ -60,23 +60,23 @@ static void setLockCount(intptr_t count) } JSLock::JSLock(ExecState* exec) - : m_lockingForReal(exec->globalData().isSharedInstance) + : m_lockBehavior(exec->globalData().isSharedInstance ? LockForReal : SilenceAssertionsOnly) { - lock(m_lockingForReal); + lock(m_lockBehavior); } -void JSLock::lock(bool lockForReal) +void JSLock::lock(JSLockBehavior lockBehavior) { #ifdef NDEBUG // Locking "not for real" is a debug-only feature. - if (!lockForReal) + if (lockBehavior == SilenceAssertionsOnly) return; #endif pthread_once(&createJSLockCountOnce, createJSLockCount); intptr_t currentLockCount = lockCount(); - if (!currentLockCount && lockForReal) { + if (!currentLockCount && lockBehavior == LockForReal) { int result; result = pthread_mutex_lock(&JSMutex); ASSERT(!result); @@ -84,19 +84,19 @@ void JSLock::lock(bool lockForReal) setLockCount(currentLockCount + 1); } -void JSLock::unlock(bool lockForReal) +void JSLock::unlock(JSLockBehavior lockBehavior) { ASSERT(lockCount()); #ifdef NDEBUG // Locking "not for real" is a debug-only feature. - if (!lockForReal) + if (lockBehavior == SilenceAssertionsOnly) return; #endif intptr_t newLockCount = lockCount() - 1; setLockCount(newLockCount); - if (!newLockCount && lockForReal) { + if (!newLockCount && lockBehavior == LockForReal) { int result; result = pthread_mutex_unlock(&JSMutex); ASSERT(!result); @@ -105,12 +105,12 @@ void JSLock::unlock(bool lockForReal) void JSLock::lock(ExecState* exec) { - lock(exec->globalData().isSharedInstance); + lock(exec->globalData().isSharedInstance ? LockForReal : SilenceAssertionsOnly); } void JSLock::unlock(ExecState* exec) { - unlock(exec->globalData().isSharedInstance); + unlock(exec->globalData().isSharedInstance ? LockForReal : SilenceAssertionsOnly); } bool JSLock::currentThreadIsHoldingLock() @@ -162,7 +162,7 @@ bool JSLock::currentThreadIsHoldingLock() static unsigned lockDropDepth = 0; JSLock::DropAllLocks::DropAllLocks(ExecState* exec) - : m_lockingForReal(exec->globalData().isSharedInstance) + : m_lockBehavior(exec->globalData().isSharedInstance ? LockForReal : SilenceAssertionsOnly) { pthread_once(&createJSLockCountOnce, createJSLockCount); @@ -173,11 +173,11 @@ JSLock::DropAllLocks::DropAllLocks(ExecState* exec) m_lockCount = JSLock::lockCount(); for (intptr_t i = 0; i < m_lockCount; i++) - JSLock::unlock(m_lockingForReal); + JSLock::unlock(m_lockBehavior); } -JSLock::DropAllLocks::DropAllLocks(bool lockingForReal) - : m_lockingForReal(lockingForReal) +JSLock::DropAllLocks::DropAllLocks(JSLockBehavior JSLockBehavior) + : m_lockBehavior(JSLockBehavior) { pthread_once(&createJSLockCountOnce, createJSLockCount); @@ -191,13 +191,13 @@ JSLock::DropAllLocks::DropAllLocks(bool lockingForReal) m_lockCount = JSLock::lockCount(); for (intptr_t i = 0; i < m_lockCount; i++) - JSLock::unlock(m_lockingForReal); + JSLock::unlock(m_lockBehavior); } JSLock::DropAllLocks::~DropAllLocks() { for (intptr_t i = 0; i < m_lockCount; i++) - JSLock::lock(m_lockingForReal); + JSLock::lock(m_lockBehavior); --lockDropDepth; } @@ -205,7 +205,7 @@ JSLock::DropAllLocks::~DropAllLocks() #else JSLock::JSLock(ExecState*) - : m_lockingForReal(false) + : m_lockBehavior(SilenceAssertionsOnly) { } @@ -221,11 +221,11 @@ bool JSLock::currentThreadIsHoldingLock() return true; } -void JSLock::lock(bool) +void JSLock::lock(JSLockBehavior) { } -void JSLock::unlock(bool) +void JSLock::unlock(JSLockBehavior) { } @@ -241,7 +241,7 @@ JSLock::DropAllLocks::DropAllLocks(ExecState*) { } -JSLock::DropAllLocks::DropAllLocks(bool) +JSLock::DropAllLocks::DropAllLocks(JSLockBehavior) { } |