Changeset 34991 in webkit for trunk/JavaScriptCore/kjs/JSLock.cpp


Ignore:
Timestamp:
Jul 3, 2008, 5:06:11 PM (17 years ago)
Author:
[email protected]
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSLock.cpp

    r34990 r34991  
    4949
    5050// Lock nesting count.
    51 ssize_t JSLock::lockCount()
    52 {
    53     pthread_once(&createJSLockCountOnce, createJSLockCount);
    54 
    55     return reinterpret_cast<ssize_t>(pthread_getspecific(JSLockCount));
    56 }
    57 
    58 static void setLockCount(ssize_t count)
     51intptr_t JSLock::lockCount()
     52{
     53    pthread_once(&createJSLockCountOnce, createJSLockCount);
     54
     55    return reinterpret_cast<intptr_t>(pthread_getspecific(JSLockCount));
     56}
     57
     58static void setLockCount(intptr_t count)
    5959{
    6060    ASSERT(count >= 0);
     
    8080    pthread_once(&createJSLockCountOnce, createJSLockCount);
    8181
    82     ssize_t currentLockCount = lockCount();
     82    intptr_t currentLockCount = lockCount();
    8383    if (!currentLockCount && lockForReal) {
    8484        int result;
     
    9999#endif
    100100
    101     ssize_t newLockCount = lockCount() - 1;
     101    intptr_t newLockCount = lockCount() - 1;
    102102    setLockCount(newLockCount);
    103103    if (!newLockCount && lockForReal) {
     
    135135
    136136    m_lockCount = JSLock::lockCount();
    137     for (ssize_t i = 0; i < m_lockCount; i++)
     137    for (intptr_t i = 0; i < m_lockCount; i++)
    138138        JSLock::unlock(m_lockingForReal);
    139139}
     
    148148
    149149    m_lockCount = JSLock::lockCount();
    150     for (ssize_t i = 0; i < m_lockCount; i++)
     150    for (intptr_t i = 0; i < m_lockCount; i++)
    151151        JSLock::unlock(m_lockingForReal);
    152152}
     
    154154JSLock::DropAllLocks::~DropAllLocks()
    155155{
    156     for (ssize_t i = 0; i < m_lockCount; i++)
     156    for (intptr_t i = 0; i < m_lockCount; i++)
    157157        JSLock::lock(m_lockingForReal);
    158158}
     
    167167// If threading support is off, set the lock count to a constant value of 1 so assertions
    168168// that the lock is held don't fail
    169 ssize_t JSLock::lockCount()
     169intptr_t JSLock::lockCount()
    170170{
    171171    return 1;
Note: See TracChangeset for help on using the changeset viewer.