Commit b152343d authored by ddkilzer's avatar ddkilzer

2007-04-25 David Kilzer <ddkilzer@apple.com>

        Reviewed by Maciej.

        Add assertions for debug builds.

        * kjs/JSLock.cpp:
        (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
        (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c73a7c63
2007-04-25 David Kilzer <ddkilzer@apple.com>
Reviewed by Maciej.
Add assertions for debug builds.
* kjs/JSLock.cpp:
(KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
(KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
2007-04-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Anders.
......
......@@ -52,7 +52,9 @@ void JSLock::lock()
pthread_once(&createDidLockJSMutexOnce, createDidLockJSMutex);
if (!pthread_getspecific(didLockJSMutex)) {
pthread_mutex_lock(&JSMutex);
int result;
result = pthread_mutex_lock(&JSMutex);
ASSERT(!result);
pthread_setspecific(didLockJSMutex, &didLockJSMutex);
}
++JSLockCount;
......@@ -66,7 +68,9 @@ void JSLock::unlock()
--JSLockCount;
if (!JSLockCount) {
pthread_setspecific(didLockJSMutex, 0);
pthread_mutex_unlock(&JSMutex);
int result;
result = pthread_mutex_unlock(&JSMutex);
ASSERT(!result);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment