Title: [263223] trunk/Source/WTF
Revision
263223
Author
gga...@apple.com
Date
2020-06-18 13:06:11 -0700 (Thu, 18 Jun 2020)

Log Message

Unreviewed, re-landing r262904.

r263219 and r263175 should fix the test flakiness we saw.

Re-landed changeset:

"[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on
a timer"
https://bugs.webkit.org/show_bug.cgi?id=213063
https://trac.webkit.org/changeset/262904

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (263222 => 263223)


--- trunk/Source/WTF/ChangeLog	2020-06-18 18:22:15 UTC (rev 263222)
+++ trunk/Source/WTF/ChangeLog	2020-06-18 20:06:11 UTC (rev 263223)
@@ -1,3 +1,16 @@
+2020-06-18  Geoffrey Garen  <gga...@apple.com>
+
+        Unreviewed, re-landing r262904.
+
+        r263219 and r263175 should fix the test flakiness we saw.
+
+        Re-landed changeset:
+
+        "[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on
+        a timer"
+        https://bugs.webkit.org/show_bug.cgi?id=213063
+        https://trac.webkit.org/changeset/262904
+
 2020-06-18  David Kilzer  <ddkil...@apple.com>
 
         [IPC hardening] OptionSet<> values should be validated

Modified: trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm (263222 => 263223)


--- trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm	2020-06-18 18:22:15 UTC (rev 263222)
+++ trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm	2020-06-18 20:06:11 UTC (rev 263223)
@@ -54,8 +54,6 @@
 WTFLogChannel LogThreading = { WTFLogChannelState::On, "Threading", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
 #endif
 
-static bool isTimerPosted; // This is only accessed on the main thread.
-
 #if USE(WEB_THREAD)
 // When the Web thread is enabled, we consider it to be the main thread, not pthread main.
 static pthread_t s_webThreadPthread;
@@ -71,44 +69,13 @@
     ASSERT(pthread_main_np());
 }
 
-static void timerFired(CFRunLoopTimerRef timer, void*)
-{
-    CFRelease(timer);
-    isTimerPosted = false;
-
-    @autoreleasepool {
-        WTF::dispatchFunctionsFromMainThread();
-    }
-}
-
-static void postTimer()
-{
-    ASSERT(isMainThread());
-
-    if (isTimerPosted)
-        return;
-
-    isTimerPosted = true;
-    CFRunLoopAddTimer(CFRunLoopGetCurrent(), CFRunLoopTimerCreate(0, 0, 0, 0, 0, timerFired, 0), kCFRunLoopCommonModes);
-}
-
 void scheduleDispatchFunctionsOnMainThread()
 {
 #if USE(WEB_THREAD)
-    if (isWebThread()) {
-        postTimer();
-        return;
-    }
-
     if (auto* webRunLoop = RunLoop::webIfExists()) {
         webRunLoop->dispatch(dispatchFunctionsFromMainThread);
         return;
     }
-#else
-    if (isMainThread()) {
-        postTimer();
-        return;
-    }
 #endif
 
     RunLoop::main().dispatch(dispatchFunctionsFromMainThread);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to