Changeset 262977 in webkit
- Timestamp:
- Jun 12, 2020 2:58:25 PM (4 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r262973 r262977 1 2020-06-12 Jason Lawrence <lawrence.j@apple.com> 2 3 Unreviewed, reverting r262904. 4 5 This commit broke a test on Mac wk1 Debug. 6 7 Reverted 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-12 Adrian Perez de Castro <aperez@igalia.com> 2 15 -
trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm
r262904 r262977 55 55 #endif 56 56 57 static bool isTimerPosted; // This is only accessed on the main thread. 58 57 59 #if USE(WEB_THREAD) 58 60 // When the Web thread is enabled, we consider it to be the main thread, not pthread main. … … 70 72 } 71 73 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 72 95 void scheduleDispatchFunctionsOnMainThread() 73 96 { 74 97 #if USE(WEB_THREAD) 98 if (isWebThread()) { 99 postTimer(); 100 return; 101 } 102 75 103 if (auto* webRunLoop = RunLoop::webIfExists()) { 76 104 webRunLoop->dispatch(dispatchFunctionsFromMainThread); 105 return; 106 } 107 #else 108 if (isMainThread()) { 109 postTimer(); 77 110 return; 78 111 }
Note: See TracChangeset
for help on using the changeset viewer.