Changeset 34990 in webkit for trunk/JavaScriptCore/kjs/JSLock.cpp
- Timestamp:
- Jul 3, 2008, 4:22:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.