[Webkit-unassigned] [Bug 22360] WTF current time code uses unprotected static variables

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 11 10:27:38 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=22360


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|JSC::getCurrentUTCTimeWithM |WTF current time code uses
                   |icroseconds uses            |unprotected static
                   |unprotected static          |variables
                   |variables                   |
           Platform|PC                          |All
         OS/Version|Mac OS X 10.5               |All
          Component|JavaScriptCore              |Web Template Framework




--- Comment #9 from Alexey Proskuryakov <ap at webkit.org>  2012-01-11 10:27:36 PST ---
> Naturally aligned memory accesses are atomic on X86

I didn't know that double accesses were also atomic. I believe x86 also has some guarantees for in-order writes, but code like below still makes me nervous:
    static bool init = false;
    static double lastTime;
    static DWORD lastTickCount;
    if (!init) {
        // ..
    }

On most platforms, monotonicallyIncreasingTime() has a whole static mach_timebase_info_data_t variable, e.g.

    static mach_timebase_info_data_t timebaseInfo;
    if (!timebaseInfo.denom) {

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list