Regression(r191673): Crash in RunLoopTimer::schedule()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Oct 2015 18:55:36 +0000 (18:55 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Oct 2015 18:55:36 +0000 (18:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150723

Reviewed by Anders Carlsson.

We were crashing in RunLoopTimer::schedule() when iterating over the
SchedulePairHashSet. The reason is that we were passing this
SchedulePairHashSet from the main thread to a background thread, which
was not safe because the SchedulePair objects inside the HashSet were
not ThreadSafeRefCounted. This patch makes them ThreadSafeRefCounted.

* wtf/SchedulePair.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191803 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/SchedulePair.h

index 06649315dc1565ee157ce5a8e67d60e6e4a7559b..dc034937897d616782dd4d4024a2efb6d43484b0 100644 (file)
@@ -1,3 +1,18 @@
+2015-10-30  Chris Dumez  <cdumez@apple.com>
+
+        Regression(r191673): Crash in RunLoopTimer::schedule()
+        https://bugs.webkit.org/show_bug.cgi?id=150723
+
+        Reviewed by Anders Carlsson.
+
+        We were crashing in RunLoopTimer::schedule() when iterating over the
+        SchedulePairHashSet. The reason is that we were passing this
+        SchedulePairHashSet from the main thread to a background thread, which
+        was not safe because the SchedulePair objects inside the HashSet were
+        not ThreadSafeRefCounted. This patch makes them ThreadSafeRefCounted.
+
+        * wtf/SchedulePair.h:
+
 2015-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Move the socket polling off the WorkQueue
index 95e0f853bfaa23bd92de7e616bed78a5089fcf3c..6039d9a378f27bc32dd74e2900b79b755a23d437 100644 (file)
@@ -30,8 +30,8 @@
 #define SchedulePair_h
 
 #include <wtf/HashSet.h>
-#include <wtf/RefCounted.h>
 #include <wtf/RetainPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/WTFString.h>
 
@@ -41,7 +41,7 @@ OBJC_CLASS NSRunLoop;
 
 namespace WTF {
 
-class SchedulePair : public RefCounted<SchedulePair> {
+class SchedulePair : public ThreadSafeRefCounted<SchedulePair> {
 public:
     static Ref<SchedulePair> create(CFRunLoopRef runLoop, CFStringRef mode) { return adoptRef(*new SchedulePair(runLoop, mode)); }