Title: [212139] trunk/Source/WTF
Revision
212139
Author
commit-qu...@webkit.org
Date
2017-02-10 13:08:32 -0800 (Fri, 10 Feb 2017)

Log Message

Fix misleading comment in RunLoop.h
https://bugs.webkit.org/show_bug.cgi?id=167832

Patch by Joseph Pecoraro <pecor...@apple.com> on 2017-02-10
Reviewed by Sam Weinig.

* wtf/RunLoop.h:
Mac initialization used to force using CFRunLoopGetMain(). Now however it just
uses RunLoop::current which uses CFRunLoopGetCurrent(). So this comment that
it can be done on any thread is misleading and can lead to incorrect behavior
if it is actually done on a non-main thread on Mac.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (212138 => 212139)


--- trunk/Source/WTF/ChangeLog	2017-02-10 20:59:40 UTC (rev 212138)
+++ trunk/Source/WTF/ChangeLog	2017-02-10 21:08:32 UTC (rev 212139)
@@ -1,3 +1,16 @@
+2017-02-10  Joseph Pecoraro  <pecor...@apple.com>
+
+        Fix misleading comment in RunLoop.h
+        https://bugs.webkit.org/show_bug.cgi?id=167832
+
+        Reviewed by Sam Weinig.
+
+        * wtf/RunLoop.h:
+        Mac initialization used to force using CFRunLoopGetMain(). Now however it just
+        uses RunLoop::current which uses CFRunLoopGetCurrent(). So this comment that
+        it can be done on any thread is misleading and can lead to incorrect behavior
+        if it is actually done on a non-main thread on Mac.
+
 2017-02-09  Alex Christensen  <achristen...@webkit.org>
 
         Unreviewed, rolling out r212040.

Modified: trunk/Source/WTF/wtf/RunLoop.cpp (212138 => 212139)


--- trunk/Source/WTF/wtf/RunLoop.cpp	2017-02-10 20:59:40 UTC (rev 212138)
+++ trunk/Source/WTF/wtf/RunLoop.cpp	2017-02-10 21:08:32 UTC (rev 212139)
@@ -50,6 +50,9 @@
 
 void RunLoop::initializeMainRunLoop()
 {
+#if OS(DARWIN)
+    ASSERT(pthread_main_np());
+#endif
     if (s_mainRunLoop)
         return;
     s_mainRunLoop = &RunLoop::current();

Modified: trunk/Source/WTF/wtf/RunLoop.h (212138 => 212139)


--- trunk/Source/WTF/wtf/RunLoop.h	2017-02-10 20:59:40 UTC (rev 212138)
+++ trunk/Source/WTF/wtf/RunLoop.h	2017-02-10 21:08:32 UTC (rev 212139)
@@ -50,8 +50,7 @@
 class RunLoop : public FunctionDispatcher {
     WTF_MAKE_NONCOPYABLE(RunLoop);
 public:
-    // Must be called from the main thread (except for the Mac platform, where it
-    // can be called from any thread).
+    // Must be called from the main thread.
     WTF_EXPORT_PRIVATE static void initializeMainRunLoop();
 
     WTF_EXPORT_PRIVATE static RunLoop& current();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to