Title: [219759] trunk/Source/WTF
Revision
219759
Author
[email protected]
Date
2017-07-21 22:14:15 -0700 (Fri, 21 Jul 2017)

Log Message

Unreviewed, rolling out r219732.
https://bugs.webkit.org/show_bug.cgi?id=174748

static is not threadsafe in WebKit tree (Requested by
yusukesuzuki on #webkit).

Reverted changeset:

"[WTF] Drop initializeDate"
https://bugs.webkit.org/show_bug.cgi?id=174714
http://trac.webkit.org/changeset/219732

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (219758 => 219759)


--- trunk/Source/WTF/ChangeLog	2017-07-22 04:43:37 UTC (rev 219758)
+++ trunk/Source/WTF/ChangeLog	2017-07-22 05:14:15 UTC (rev 219759)
@@ -1,3 +1,17 @@
+2017-07-21  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r219732.
+        https://bugs.webkit.org/show_bug.cgi?id=174748
+
+        static is not threadsafe in WebKit tree (Requested by
+        yusukesuzuki on #webkit).
+
+        Reverted changeset:
+
+        "[WTF] Drop initializeDate"
+        https://bugs.webkit.org/show_bug.cgi?id=174714
+        http://trac.webkit.org/changeset/219732
+
 2017-07-21  Yusuke Suzuki  <[email protected]>
 
         [WTF] Drop initializeDate

Modified: trunk/Source/WTF/wtf/DateMath.cpp (219758 => 219759)


--- trunk/Source/WTF/wtf/DateMath.cpp	2017-07-22 04:43:37 UTC (rev 219758)
+++ trunk/Source/WTF/wtf/DateMath.cpp	2017-07-22 05:14:15 UTC (rev 219759)
@@ -346,7 +346,7 @@
     // It is ok if the cached year is not the current year as long as the rules
     // for DST did not change between the two years; if they did the app would need
     // to be restarted.
-    static const int minYear { minimumYearForDST() };
+    static int minYear = minimumYearForDST();
     int maxYear = maximumYearForDST();
 
     int difference;
@@ -551,6 +551,17 @@
 #endif
 }
 
+void initializeDates()
+{
+#if !ASSERT_DISABLED
+    static bool alreadyInitialized;
+    ASSERT(!alreadyInitialized);
+    alreadyInitialized = true;
+#endif
+
+    equivalentYearForDST(2000); // Need to call once to initialize a static used in this function.
+}
+
 static inline double ymdhmsToSeconds(int year, long mon, long day, long hour, long minute, double second)
 {
     int mday = firstDayOfMonth[isLeapYear(year)][mon - 1];

Modified: trunk/Source/WTF/wtf/Threading.cpp (219758 => 219759)


--- trunk/Source/WTF/wtf/Threading.cpp	2017-07-22 04:43:37 UTC (rev 219758)
+++ trunk/Source/WTF/wtf/Threading.cpp	2017-07-22 05:14:15 UTC (rev 219759)
@@ -248,6 +248,7 @@
         ThreadHolder::initializeOnce();
         initializeRandomNumberGenerator();
         wtfThreadData();
+        initializeDates();
         Thread::initializePlatformThreading();
     });
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to