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


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

Fix the 64-bit build.

File:
1 edited

Legend:

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

    r34954 r34990  
    4949
    5050// Lock nesting count.
    51 int JSLock::lockCount()
    52 {
    53     pthread_once(&createJSLockCountOnce, createJSLockCount);
    54 
    55     return reinterpret_cast<int>(pthread_getspecific(JSLockCount));
    56 }
    57 
    58 static void setLockCount(int count)
    59 {
     51ssize_t JSLock::lockCount()
     52{
     53    pthread_once(&createJSLockCountOnce, createJSLockCount);
     54
     55    return reinterpret_cast<ssize_t>(pthread_getspecific(JSLockCount));
     56}
     57
     58static void setLockCount(ssize_t count)
     59{
     60    ASSERT(count >= 0);
    6061    pthread_setspecific(JSLockCount, reinterpret_cast<void*>(count));
    6162}
     
    7980    pthread_once(&createJSLockCountOnce, createJSLockCount);
    8081
    81     int currentLockCount = lockCount();
     82    ssize_t currentLockCount = lockCount();
    8283    if (!currentLockCount && lockForReal) {
    8384        int result;
     
    9899#endif
    99100
    100     int newLockCount = lockCount() - 1;
     101    ssize_t newLockCount = lockCount() - 1;
    101102    setLockCount(newLockCount);
    102103    if (!newLockCount && lockForReal) {
     
    134135
    135136    m_lockCount = JSLock::lockCount();
    136     for (int i = 0; i < m_lockCount; i++)
     137    for (ssize_t i = 0; i < m_lockCount; i++)
    137138        JSLock::unlock(m_lockingForReal);
    138139}
     
    147148
    148149    m_lockCount = JSLock::lockCount();
    149     for (int i = 0; i < m_lockCount; i++)
     150    for (ssize_t i = 0; i < m_lockCount; i++)
    150151        JSLock::unlock(m_lockingForReal);
    151152}
     
    153154JSLock::DropAllLocks::~DropAllLocks()
    154155{
    155     for (int i = 0; i < m_lockCount; i++)
     156    for (ssize_t i = 0; i < m_lockCount; i++)
    156157        JSLock::lock(m_lockingForReal);
    157158}
     
    166167// If threading support is off, set the lock count to a constant value of 1 so assertions
    167168// that the lock is held don't fail
    168 int JSLock::lockCount()
     169ssize_t JSLock::lockCount()
    169170{
    170171    return 1;
Note: See TracChangeset for help on using the changeset viewer.