RESOLVED FIXED 126215
Replace WTF::ThreadingOnce with std::call_once
https://bugs.webkit.org/show_bug.cgi?id=126215
Summary Replace WTF::ThreadingOnce with std::call_once
Anders Carlsson
Reported 2013-12-24 09:55:32 PST
Replace WTF::ThreadingOnce with std::call_once
Attachments
Patch (9.26 KB, patch)
2013-12-24 12:48 PST, Anders Carlsson
no flags
Anders Carlsson
Comment 1 2013-12-24 12:48:28 PST
WebKit Commit Bot
Comment 2 2013-12-24 12:51:12 PST
Attachment 219977 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/dfg/DFGWorklist.cpp', u'Source/JavaScriptCore/runtime/InitializeThreading.cpp', u'Source/WTF/ChangeLog', u'Source/WTF/GNUmakefile.list.am', u'Source/WTF/wtf/CompilationThread.cpp', u'Source/WTF/wtf/ThreadingOnce.h', '--commit-queue']" exit_code: 1 ERROR: Source/JavaScriptCore/runtime/InitializeThreading.cpp:55: Missing space before { [whitespace/braces] [5] ERROR: Source/WTF/wtf/CompilationThread.cpp:41: Missing space before { [whitespace/braces] [5] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Sam Weinig
Comment 3 2013-12-24 18:32:31 PST
Not that it matters in these places much, but how does the performance of std::call_once compare to pthread_once and dispatch_once? I see in libc++'s implementation there is comment stating it should consider moving to dispatch_once (presumably for performance reasons) http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/mutex.cpp?view=markup#l209. The comment seems predicated on dispatch_once_f supporting c++ exceptions, but perhaps the maintainers would consider an optimized version when exceptions were disabled as they are with WebKit.
Anders Carlsson
Comment 4 2013-12-30 10:54:43 PST
(In reply to comment #3) > Not that it matters in these places much, but how does the performance of std::call_once compare to pthread_once and dispatch_once? It's faster than pthread_once since the first check ends up being inlined.
WebKit Commit Bot
Comment 5 2013-12-30 11:29:11 PST
Comment on attachment 219977 [details] Patch Clearing flags on attachment: 219977 Committed r161146: <http://trac.webkit.org/changeset/161146>
WebKit Commit Bot
Comment 6 2013-12-30 11:29:13 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.