Changeset 160116 in webkit
- Timestamp:
- Dec 4, 2013 12:43:21 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r160115 r160116 1 2013-12-04 peavo@outlook.com <peavo@outlook.com> 2 3 Use ThreadingOnce class to encapsulate pthread_once functionality. 4 https://bugs.webkit.org/show_bug.cgi?id=125228 5 6 Reviewed by Brent Fulgham. 7 8 * runtime/InitializeThreading.cpp: 9 (JSC::initializeThreading): 10 1 11 2013-12-04 Mark Lam <mark.lam@apple.com> 2 12 -
trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp
r157539 r160116 42 42 #include <wtf/dtoa.h> 43 43 #include <wtf/Threading.h> 44 #include <wtf/ThreadingOnce.h> 44 45 #include <wtf/dtoa/cached-powers.h> 45 46 … … 47 48 48 49 namespace JSC { 49 50 #if OS(DARWIN)51 static pthread_once_t initializeThreadingKeyOnce = PTHREAD_ONCE_INIT;52 #endif53 50 54 51 static void initializeThreadingOnce() … … 77 74 void initializeThreading() 78 75 { 79 #if OS(DARWIN) 80 pthread_once(&initializeThreadingKeyOnce, initializeThreadingOnce); 81 #else 82 static bool initializedThreading = false; 83 if (!initializedThreading) { 84 initializeThreadingOnce(); 85 initializedThreading = true; 86 } 87 #endif 76 static WTF::ThreadingOnce initializeThreadingKeyOnce; 77 initializeThreadingKeyOnce.callOnce(initializeThreadingOnce); 88 78 } 89 79
Note: See TracChangeset
for help on using the changeset viewer.