Changeset 263223 in webkit
- Timestamp:
- Jun 18, 2020 1:06:11 PM (4 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r263208 r263223 1 2020-06-18 Geoffrey Garen <ggaren@apple.com> 2 3 Unreviewed, re-landing r262904. 4 5 r263219 and r263175 should fix the test flakiness we saw. 6 7 Re-landed changeset: 8 9 "[Cocoa] Build callOnMainThread on WTF::RunLoop rather than on 10 a timer" 11 https://bugs.webkit.org/show_bug.cgi?id=213063 12 https://trac.webkit.org/changeset/262904 13 1 14 2020-06-18 David Kilzer <ddkilzer@apple.com> 2 15 -
trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm
r262977 r263223 55 55 #endif 56 56 57 static bool isTimerPosted; // This is only accessed on the main thread.58 59 57 #if USE(WEB_THREAD) 60 58 // When the Web thread is enabled, we consider it to be the main thread, not pthread main. … … 72 70 } 73 71 74 static void timerFired(CFRunLoopTimerRef timer, void*)75 {76 CFRelease(timer);77 isTimerPosted = false;78 79 @autoreleasepool {80 WTF::dispatchFunctionsFromMainThread();81 }82 }83 84 static void postTimer()85 {86 ASSERT(isMainThread());87 88 if (isTimerPosted)89 return;90 91 isTimerPosted = true;92 CFRunLoopAddTimer(CFRunLoopGetCurrent(), CFRunLoopTimerCreate(0, 0, 0, 0, 0, timerFired, 0), kCFRunLoopCommonModes);93 }94 95 72 void scheduleDispatchFunctionsOnMainThread() 96 73 { 97 74 #if USE(WEB_THREAD) 98 if (isWebThread()) {99 postTimer();100 return;101 }102 103 75 if (auto* webRunLoop = RunLoop::webIfExists()) { 104 76 webRunLoop->dispatch(dispatchFunctionsFromMainThread); 105 return;106 }107 #else108 if (isMainThread()) {109 postTimer();110 77 return; 111 78 }
Note: See TracChangeset
for help on using the changeset viewer.