Changeset 32808 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- May 2, 2008, 3:29:47 AM (17 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/InitializeThreading.cpp
r32807 r32808 42 42 namespace KJS { 43 43 44 void initializeThreading() 44 #if PLATFORM(DARWIN) 45 static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT; 46 #endif 47 48 static void initializeThreadingOnce() 45 49 { 46 50 WTF::initializeThreading(); 47 51 #if USE(MULTIPLE_THREADS) 48 if (!s_dtoaP5Mutex) { 49 s_dtoaP5Mutex = new Mutex; 50 Heap::threadHeap(); 51 UString::null(); 52 Identifier::initializeIdentifierThreading(); 53 CommonIdentifiers::shared(); 54 lexer(); 55 initDateMath(); 56 JSGlobalObject::threadClassInfoHashTables(); 57 JSGlobalObject::head(); 52 s_dtoaP5Mutex = new Mutex; 53 Heap::threadHeap(); 54 UString::null(); 55 Identifier::initializeIdentifierThreading(); 56 CommonIdentifiers::shared(); 57 lexer(); 58 initDateMath(); 59 JSGlobalObject::threadClassInfoHashTables(); 60 JSGlobalObject::head(); 61 #endif 62 } 63 64 void initializeThreading() 65 { 66 #if PLATFORM(DARWIN) 67 pthread_once(&initializeThreadingKeyOnce, initializeThreadingOnce); 68 #else 69 static bool initializedThreading = false; 70 if (!initializedThreading) { 71 initializeThreadingOnce(); 72 initializedThreading = true; 58 73 } 59 74 #endif -
trunk/JavaScriptCore/kjs/InitializeThreading.h
r31404 r32808 32 32 namespace KJS { 33 33 34 // This function must be called from the main thread. It is safe to call it repeatedly. 35 // Darwin is an exception to this rule: it is OK to call this function from any thread, even reentrantly. 34 36 void initializeThreading(); 35 37
Note:
See TracChangeset
for help on using the changeset viewer.