Changeset 38622 in webkit for trunk/JavaScriptCore/runtime/Collector.cpp
- Timestamp:
- Nov 20, 2008, 10:11:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Collector.cpp
r38528 r38622 122 122 #if ENABLE(JSC_MULTIPLE_THREADS) 123 123 , m_registeredThreads(0) 124 , m_currentThreadRegistrar(0) 124 125 #endif 125 126 , m_globalData(globalData) 126 127 { 127 128 ASSERT(globalData); 128 129 #if ENABLE(JSC_MULTIPLE_THREADS)130 int error = pthread_key_create(&m_currentThreadRegistrar, unregisterThread);131 if (error)132 CRASH();133 #endif134 129 135 130 memset(&primaryHeap, 0, sizeof(CollectorHeap)); … … 166 161 167 162 #if ENABLE(JSC_MULTIPLE_THREADS) 163 if (m_currentThreadRegistrar) { 168 164 #ifndef NDEBUG 169 int error = 170 #endif 171 pthread_key_delete(m_currentThreadRegistrar); 172 ASSERT(!error); 165 int error = 166 #endif 167 pthread_key_delete(m_currentThreadRegistrar); 168 ASSERT(!error); 169 } 173 170 174 171 MutexLocker registeredThreadsLock(m_registeredThreadsMutex); … … 479 476 } 480 477 478 void Heap::makeUsableFromMultipleThreads() 479 { 480 if (m_currentThreadRegistrar) 481 return; 482 483 int error = pthread_key_create(&m_currentThreadRegistrar, unregisterThread); 484 if (error) 485 CRASH(); 486 } 487 481 488 void Heap::registerThread() 482 489 { 483 if ( pthread_getspecific(m_currentThreadRegistrar))490 if (!m_currentThreadRegistrar || pthread_getspecific(m_currentThreadRegistrar)) 484 491 return; 485 492
Note:
See TracChangeset
for help on using the changeset viewer.