Title: [188719] trunk/Source
Revision
188719
Author
[email protected]
Date
2015-08-20 17:11:10 -0700 (Thu, 20 Aug 2015)

Log Message

Merge ConditionBase and Condition
https://bugs.webkit.org/show_bug.cgi?id=148270

Reviewed by Filip Pizlo.

Source/WebCore:

Change StaticCondition to Condition.

* platform/network/cf/LoaderRunLoopCF.cpp:

Source/WTF:

* wtf/Condition.h:
Direct initialize m_hasWaiters so Condition gets a constexpr constructor.

* wtf/Lock.h:
Remove a now outdated comment.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (188718 => 188719)


--- trunk/Source/WTF/ChangeLog	2015-08-21 00:01:11 UTC (rev 188718)
+++ trunk/Source/WTF/ChangeLog	2015-08-21 00:11:10 UTC (rev 188719)
@@ -1,5 +1,18 @@
 2015-08-20  Anders Carlsson  <[email protected]>
 
+        Merge ConditionBase and Condition
+        https://bugs.webkit.org/show_bug.cgi?id=148270
+
+        Reviewed by Filip Pizlo.
+
+        * wtf/Condition.h:
+        Direct initialize m_hasWaiters so Condition gets a constexpr constructor.
+
+        * wtf/Lock.h:
+        Remove a now outdated comment.
+
+2015-08-20  Anders Carlsson  <[email protected]>
+
         Merge Lock and LockBase
         https://bugs.webkit.org/show_bug.cgi?id=148266
 

Modified: trunk/Source/WTF/wtf/Condition.h (188718 => 188719)


--- trunk/Source/WTF/wtf/Condition.h	2015-08-21 00:01:11 UTC (rev 188718)
+++ trunk/Source/WTF/wtf/Condition.h	2015-08-21 00:11:10 UTC (rev 188719)
@@ -43,9 +43,7 @@
 // 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.
 
-// This is a struct without a constructor or destructor so that it can be statically initialized.
-// Use Lock in instance variables.
-struct ConditionBase {
+struct Condition {
     typedef ParkingLot::Clock Clock;
     
     // Wait on a parking queue while releasing the given lock. It will unlock the lock just before
@@ -228,24 +226,12 @@
         return Clock::now() + myRelativeTimeout;
     }
 
-    Atomic<bool> m_hasWaiters;
+    Atomic<bool> m_hasWaiters { false };
 };    
 
-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.h (188718 => 188719)


--- trunk/Source/WTF/wtf/Lock.h	2015-08-21 00:01:11 UTC (rev 188718)
+++ trunk/Source/WTF/wtf/Lock.h	2015-08-21 00:11:10 UTC (rev 188719)
@@ -43,8 +43,6 @@
 // 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.
 
-// This is a struct without a constructor or destructor so that it can be statically initialized.
-// Use Lock in instance variables.
 struct Lock {
     void lock()
     {

Modified: trunk/Source/WebCore/ChangeLog (188718 => 188719)


--- trunk/Source/WebCore/ChangeLog	2015-08-21 00:01:11 UTC (rev 188718)
+++ trunk/Source/WebCore/ChangeLog	2015-08-21 00:11:10 UTC (rev 188719)
@@ -1,5 +1,16 @@
 2015-08-20  Anders Carlsson  <[email protected]>
 
+        Merge ConditionBase and Condition
+        https://bugs.webkit.org/show_bug.cgi?id=148270
+
+        Reviewed by Filip Pizlo.
+
+        Change StaticCondition to Condition.
+
+        * platform/network/cf/LoaderRunLoopCF.cpp:
+
+2015-08-20  Anders Carlsson  <[email protected]>
+
         Stop using cancelCallOnMainThread in MediaPlayerPrivateMediaFoundation
         https://bugs.webkit.org/show_bug.cgi?id=148252
 

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


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

Reply via email to