Summary: | monotonicallyIncreasingTime() should only initialize its static timebaseInfo once | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||
Component: | JavaScriptCore | Assignee: | Mark Lam <mark.lam> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | benjamin, cmarcelo, commit-queue, fpizlo, ggaren, mhahnenberg, mmirman, msaboff, oliver, simon.fraser | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Mark Lam
2014-04-14 12:51:58 PDT
Created attachment 229302 [details]
the patch
Comment on attachment 229302 [details] the patch 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". Thanks. Patch has been updated as suggested. Landed in r167263: <http://trac.webkit.org/r167263>. |