Commit a6ae59e2 authored by mrowe@apple.com's avatar mrowe@apple.com

Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as the...

Follow-up to the 64-bit build fix.  Use intptr_t rather than ssize_t as the latter is non-standard and does not exist on Windows.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 87c9d996
2008-07-03 Mark Rowe <mrowe@apple.com>
Follow-up to the 64-bit build fix. Use intptr_t rather than ssize_t as
the latter is non-standard and does not exist on Windows.
* kjs/JSLock.cpp:
(KJS::JSLock::lockCount):
(KJS::JSLock::lock):
(KJS::JSLock::unlock):
(KJS::JSLock::DropAllLocks::DropAllLocks):
* kjs/JSLock.h:
2008-07-02 Mark Rowe <mrowe@apple.com>
Fix the 64-bit build. pthread_getspecific works with pointer-sized values,
......@@ -48,14 +48,14 @@ static void createJSLockCount()
pthread_once_t createJSLockCountOnce = PTHREAD_ONCE_INIT;
// Lock nesting count.
ssize_t JSLock::lockCount()
intptr_t JSLock::lockCount()
{
pthread_once(&createJSLockCountOnce, createJSLockCount);
return reinterpret_cast<ssize_t>(pthread_getspecific(JSLockCount));
return reinterpret_cast<intptr_t>(pthread_getspecific(JSLockCount));
}
static void setLockCount(ssize_t count)
static void setLockCount(intptr_t count)
{
ASSERT(count >= 0);
pthread_setspecific(JSLockCount, reinterpret_cast<void*>(count));
......@@ -79,7 +79,7 @@ void JSLock::lock(bool lockForReal)
pthread_once(&createJSLockCountOnce, createJSLockCount);
ssize_t currentLockCount = lockCount();
intptr_t currentLockCount = lockCount();
if (!currentLockCount && lockForReal) {
int result;
result = pthread_mutex_lock(&JSMutex);
......@@ -98,7 +98,7 @@ void JSLock::unlock(bool lockForReal)
return;
#endif
ssize_t newLockCount = lockCount() - 1;
intptr_t newLockCount = lockCount() - 1;
setLockCount(newLockCount);
if (!newLockCount && lockForReal) {
int result;
......@@ -134,7 +134,7 @@ JSLock::DropAllLocks::DropAllLocks(ExecState* exec)
pthread_once(&createJSLockCountOnce, createJSLockCount);
m_lockCount = JSLock::lockCount();
for (ssize_t i = 0; i < m_lockCount; i++)
for (intptr_t i = 0; i < m_lockCount; i++)
JSLock::unlock(m_lockingForReal);
}
......@@ -147,13 +147,13 @@ JSLock::DropAllLocks::DropAllLocks(bool lockingForReal)
// will prevent a real lock from being taken.
m_lockCount = JSLock::lockCount();
for (ssize_t i = 0; i < m_lockCount; i++)
for (intptr_t i = 0; i < m_lockCount; i++)
JSLock::unlock(m_lockingForReal);
}
JSLock::DropAllLocks::~DropAllLocks()
{
for (ssize_t i = 0; i < m_lockCount; i++)
for (intptr_t i = 0; i < m_lockCount; i++)
JSLock::lock(m_lockingForReal);
}
......@@ -166,7 +166,7 @@ JSLock::JSLock(ExecState* exec)
// If threading support is off, set the lock count to a constant value of 1 so assertions
// that the lock is held don't fail
ssize_t JSLock::lockCount()
intptr_t JSLock::lockCount()
{
return 1;
}
......
......@@ -84,7 +84,7 @@ namespace KJS {
static void lock(ExecState*);
static void unlock(ExecState*);
static ssize_t lockCount();
static intptr_t lockCount();
static bool currentThreadIsHoldingLock();
static void registerThread();
......@@ -98,7 +98,7 @@ namespace KJS {
~DropAllLocks();
private:
ssize_t m_lockCount;
intptr_t m_lockCount;
bool m_lockingForReal;
};
};
......
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