[webkit-reviews] review granted: [Bug 131630] monotonicallyIncreasingTime() should only initialize its static timebaseInfo once : [Attachment 229302] the patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 14 13:20:07 PDT 2014
Filip Pizlo <fpizlo at apple.com> has granted Mark Lam <mark.lam at apple.com>'s
request for review:
Bug 131630: monotonicallyIncreasingTime() should only initialize its static
timebaseInfo once
https://bugs.webkit.org/show_bug.cgi?id=131630
Attachment 229302: the patch
https://bugs.webkit.org/attachment.cgi?id=229302&action=review
------- Additional Comments from Filip Pizlo <fpizlo at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=229302&action=review
> Source/WTF/wtf/CurrentTime.cpp:278
> // Based on listing #2 from Apple QA 1398.
> static mach_timebase_info_data_t timebaseInfo;
> - if (!timebaseInfo.denom) {
> + static std::once_flag initializeTimerOnceFlag;
> + std::call_once(initializeTimerOnceFlag, [] {
You should change the comment to say that it fixes the race condition in that
listing. Say something like "Based on listing #2 from Apple QA 1398, but
modified to be thread-safe".
More information about the webkit-reviews
mailing list