Changeset 34990 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 3, 2008, 4:22:06 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r34985 r34990 1 2008-07-02 Mark Rowe <[email protected]> 2 3 Fix the 64-bit build. pthread_getspecific works with pointer-sized values, 4 so use ssize_t rather than int to track the lock count to avoid warnings about 5 truncating the result of pthread_getspecific. 6 7 * kjs/JSLock.cpp: 8 (KJS::JSLock::lockCount): 9 (KJS::JSLock::lock): 10 (KJS::JSLock::unlock): 11 (KJS::JSLock::DropAllLocks::DropAllLocks): 12 * kjs/JSLock.h: 13 1 14 2008-07-03 Geoffrey Garen <[email protected]> 2 15 -
trunk/JavaScriptCore/kjs/JSLock.cpp
r34954 r34990 49 49 50 50 // 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 { 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) 59 { 60 ASSERT(count >= 0); 60 61 pthread_setspecific(JSLockCount, reinterpret_cast<void*>(count)); 61 62 } … … 79 80 pthread_once(&createJSLockCountOnce, createJSLockCount); 80 81 81 int currentLockCount = lockCount();82 ssize_t currentLockCount = lockCount(); 82 83 if (!currentLockCount && lockForReal) { 83 84 int result; … … 98 99 #endif 99 100 100 int newLockCount = lockCount() - 1;101 ssize_t newLockCount = lockCount() - 1; 101 102 setLockCount(newLockCount); 102 103 if (!newLockCount && lockForReal) { … … 134 135 135 136 m_lockCount = JSLock::lockCount(); 136 for ( int i = 0; i < m_lockCount; i++)137 for (ssize_t i = 0; i < m_lockCount; i++) 137 138 JSLock::unlock(m_lockingForReal); 138 139 } … … 147 148 148 149 m_lockCount = JSLock::lockCount(); 149 for ( int i = 0; i < m_lockCount; i++)150 for (ssize_t i = 0; i < m_lockCount; i++) 150 151 JSLock::unlock(m_lockingForReal); 151 152 } … … 153 154 JSLock::DropAllLocks::~DropAllLocks() 154 155 { 155 for ( int i = 0; i < m_lockCount; i++)156 for (ssize_t i = 0; i < m_lockCount; i++) 156 157 JSLock::lock(m_lockingForReal); 157 158 } … … 166 167 // If threading support is off, set the lock count to a constant value of 1 so assertions 167 168 // that the lock is held don't fail 168 int JSLock::lockCount()169 ssize_t JSLock::lockCount() 169 170 { 170 171 return 1; -
trunk/JavaScriptCore/kjs/JSLock.h
r34947 r34990 85 85 static void unlock(ExecState*); 86 86 87 static int lockCount();87 static ssize_t lockCount(); 88 88 static bool currentThreadIsHoldingLock(); 89 89 … … 99 99 100 100 private: 101 int m_lockCount;101 ssize_t m_lockCount; 102 102 bool m_lockingForReal; 103 103 };
Note:
See TracChangeset
for help on using the changeset viewer.