Title: [188722] trunk/Source
Revision
188722
Author
[email protected]
Date
2015-08-20 17:47:16 -0700 (Thu, 20 Aug 2015)

Log Message

Unreviewed, rolling out r188717 and r188719.
https://bugs.webkit.org/show_bug.cgi?id=148272

Broke the Mavericks build (Requested by andersca on #webkit).

Reverted changesets:

"Merge Lock and LockBase"
https://bugs.webkit.org/show_bug.cgi?id=148266
http://trac.webkit.org/changeset/188717

"Merge ConditionBase and Condition"
https://bugs.webkit.org/show_bug.cgi?id=148270
http://trac.webkit.org/changeset/188719

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (188721 => 188722)


--- trunk/Source/WTF/ChangeLog	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WTF/ChangeLog	2015-08-21 00:47:16 UTC (rev 188722)
@@ -1,3 +1,20 @@
+2015-08-20  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r188717 and r188719.
+        https://bugs.webkit.org/show_bug.cgi?id=148272
+
+        Broke the Mavericks build (Requested by andersca on #webkit).
+
+        Reverted changesets:
+
+        "Merge Lock and LockBase"
+        https://bugs.webkit.org/show_bug.cgi?id=148266
+        http://trac.webkit.org/changeset/188717
+
+        "Merge ConditionBase and Condition"
+        https://bugs.webkit.org/show_bug.cgi?id=148270
+        http://trac.webkit.org/changeset/188719
+
 2015-08-20  Anders Carlsson  <[email protected]>
 
         Merge ConditionBase and Condition

Modified: trunk/Source/WTF/wtf/Atomics.h (188721 => 188722)


--- trunk/Source/WTF/wtf/Atomics.h	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WTF/wtf/Atomics.h	2015-08-21 00:47:16 UTC (rev 188722)
@@ -81,12 +81,6 @@
 
 template<typename T>
 struct Atomic {
-    Atomic() = default;
-    CONSTEXPR Atomic(T value)
-        : value(value)
-    {
-    }
-
     // Don't pass a non-default value for the order parameter unless you really know
     // what you are doing and have thought about it very hard. The cost of seq_cst
     // is usually not high enough to justify the risk.

Modified: trunk/Source/WTF/wtf/Condition.h (188721 => 188722)


--- trunk/Source/WTF/wtf/Condition.h	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WTF/wtf/Condition.h	2015-08-21 00:47:16 UTC (rev 188722)
@@ -43,7 +43,9 @@
 // case where no thread is waiting. This condition variable, when used with WTF::Lock, can
 // outperform a system condition variable and lock by up to 58x.
 
-struct Condition {
+// This is a struct without a constructor or destructor so that it can be statically initialized.
+// Use Lock in instance variables.
+struct ConditionBase {
     typedef ParkingLot::Clock Clock;
     
     // Wait on a parking queue while releasing the given lock. It will unlock the lock just before
@@ -226,12 +228,24 @@
         return Clock::now() + myRelativeTimeout;
     }
 
-    Atomic<bool> m_hasWaiters { false };
+    Atomic<bool> m_hasWaiters;
 };    
 
+class Condition : public ConditionBase {
+    WTF_MAKE_NONCOPYABLE(Condition);
+public:
+    Condition()
+    {
+        m_hasWaiters.store(false);
+    }
+};
+
+typedef ConditionBase StaticCondition;
+
 } // namespace WTF
 
 using WTF::Condition;
+using WTF::StaticCondition;
 
 #endif // WTF_Condition_h
 

Modified: trunk/Source/WTF/wtf/Lock.cpp (188721 => 188722)


--- trunk/Source/WTF/wtf/Lock.cpp	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WTF/wtf/Lock.cpp	2015-08-21 00:47:16 UTC (rev 188722)
@@ -36,7 +36,7 @@
 
 static const bool verbose = false;
 
-void Lock::lockSlow()
+void LockBase::lockSlow()
 {
     unsigned spinCount = 0;
 
@@ -74,7 +74,7 @@
     }
 }
 
-void Lock::unlockSlow()
+void LockBase::unlockSlow()
 {
     // We could get here because the weak CAS in unlock() failed spuriously, or because there is
     // someone parked. So, we need a CAS loop: even if right now the lock is just held, it could

Modified: trunk/Source/WTF/wtf/Lock.h (188721 => 188722)


--- trunk/Source/WTF/wtf/Lock.h	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WTF/wtf/Lock.h	2015-08-21 00:47:16 UTC (rev 188722)
@@ -43,7 +43,9 @@
 // cannot be acquired in a short period of time, the thread is put to sleep until the lock is available
 // again). It uses less memory than a std::mutex.
 
-struct Lock {
+// This is a struct without a constructor or destructor so that it can be statically initialized.
+// Use Lock in instance variables.
+struct LockBase {
     void lock()
     {
         if (LIKELY(m_byte.compareExchangeWeak(0, isHeldBit, std::memory_order_acquire))) {
@@ -106,13 +108,20 @@
         return !m_byte.load();
     }
 
-    Atomic<uint8_t> m_byte { 0 };
+    Atomic<uint8_t> m_byte;
 };
 
-typedef Locker<Lock> LockHolder;
+class Lock : public LockBase {
+    WTF_MAKE_NONCOPYABLE(Lock);
+public:
+    Lock()
+    {
+        m_byte.store(0, std::memory_order_relaxed);
+    }
+};
 
-// FIXME: Once all clients have been moved from StaticLock to Lock we can get rid of this typedef.
-typedef Lock StaticLock;
+typedef LockBase StaticLock;
+typedef Locker<LockBase> LockHolder;
 
 } // namespace WTF
 

Modified: trunk/Source/WTF/wtf/WordLock.h (188721 => 188722)


--- trunk/Source/WTF/wtf/WordLock.h	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WTF/wtf/WordLock.h	2015-08-21 00:47:16 UTC (rev 188722)
@@ -45,7 +45,10 @@
 class WordLock {
     WTF_MAKE_NONCOPYABLE(WordLock);
 public:
-    CONSTEXPR WordLock() = default;
+    WordLock()
+    {
+        m_word.store(0, std::memory_order_relaxed);
+    }
 
     void lock()
     {
@@ -93,7 +96,7 @@
         return !m_word.load();
     }
 
-    Atomic<uintptr_t> m_word { 0 };
+    Atomic<uintptr_t> m_word;
 };
 
 typedef Locker<WordLock> WordLockHolder;

Modified: trunk/Source/WebCore/ChangeLog (188721 => 188722)


--- trunk/Source/WebCore/ChangeLog	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WebCore/ChangeLog	2015-08-21 00:47:16 UTC (rev 188722)
@@ -1,3 +1,20 @@
+2015-08-20  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r188717 and r188719.
+        https://bugs.webkit.org/show_bug.cgi?id=148272
+
+        Broke the Mavericks build (Requested by andersca on #webkit).
+
+        Reverted changesets:
+
+        "Merge Lock and LockBase"
+        https://bugs.webkit.org/show_bug.cgi?id=148266
+        http://trac.webkit.org/changeset/188717
+
+        "Merge ConditionBase and Condition"
+        https://bugs.webkit.org/show_bug.cgi?id=148270
+        http://trac.webkit.org/changeset/188719
+
 2015-08-20  Anders Carlsson  <[email protected]>
 
         Merge ConditionBase and Condition

Modified: trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp (188721 => 188722)


--- trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp	2015-08-21 00:26:46 UTC (rev 188721)
+++ trunk/Source/WebCore/platform/network/cf/LoaderRunLoopCF.cpp	2015-08-21 00:47:16 UTC (rev 188722)
@@ -43,7 +43,7 @@
 static CFRunLoopRef loaderRunLoopObject = 0;
 
 static StaticLock loaderRunLoopMutex;
-static Condition loaderRunLoopConditionVariable;
+static StaticCondition loaderRunLoopConditionVariable;
 
 static void emptyPerform(void*) 
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to