Changeset 58393 in webkit
- Timestamp:
- Apr 28, 2010 2:06:20 AM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r58392 r58393 1 2010-04-28 Simon Hausmann <simon.hausmann@nokia.com>, Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 JSC's currentThreadStackBase is not reentrant on some platforms 6 https://bugs.webkit.org/show_bug.cgi?id=37195 7 8 This function needs to be reentrant to avoid memory corruption on platforms where 9 the implementation uses global variables. 10 11 This patch adds a mutex lock where necessary and makes the Symbian implementation 12 reentrant. 13 14 * runtime/Collector.cpp: 15 (JSC::currentThreadStackBaseMutex): 16 (JSC::currentThreadStackBase): 17 1 18 2010-04-28 Thiago Macieira <thiago.macieira@nokia.com> 2 19 -
trunk/JavaScriptCore/runtime/Collector.cpp
r58134 r58393 559 559 return reinterpret_cast<void*>(pTib->StackBase); 560 560 #elif OS(QNX) 561 AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); 562 MutexLocker locker(mutex); 561 563 return currentThreadStackBaseQNX(); 562 564 #elif OS(SOLARIS) … … 570 572 return stack.ss_sp; 571 573 #elif OS(SYMBIAN) 572 static void* stackBase = 0; 573 if (stackBase == 0) { 574 TThreadStackInfo info; 575 RThread thread; 576 thread.StackInfo(info); 577 stackBase = (void*)info.iBase; 578 } 579 return (void*)stackBase; 574 TThreadStackInfo info; 575 RThread thread; 576 thread.StackInfo(info); 577 return (void*)info.iBase; 580 578 #elif OS(HAIKU) 581 579 thread_info threadInfo; … … 583 581 return threadInfo.stack_end; 584 582 #elif OS(UNIX) 583 AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); 584 MutexLocker locker(mutex); 585 585 static void* stackBase = 0; 586 586 static size_t stackSize = 0; … … 605 605 return static_cast<char*>(stackBase) + stackSize; 606 606 #elif OS(WINCE) 607 AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); 608 MutexLocker locker(mutex); 607 609 if (g_stackBase) 608 610 return g_stackBase;
Note: See TracChangeset
for help on using the changeset viewer.