Some style improvements to main thread code
Created attachment 401590 [details] Patch
Created attachment 401591 [details] Patch
Comment on attachment 401591 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401591&action=review > Source/WTF/wtf/cocoa/MainThreadCocoa.mm:61 > +static pthread_t s_webThreadPthread { nullptr }; The "{ nullptr }" has no effect or value here. > Source/WTF/wtf/cocoa/MainThreadCocoa.mm:106 > + if (RunLoop::webIfExists()) { > RunLoop::web().dispatch(dispatchFunctionsFromMainThread); > return; > } Why get it twice? Put it in a local variable and use it? > Source/WebKit/Shared/WebKit2Initialize.cpp:43 > JSC::initializeThreading(); > - RunLoop::initializeMainRunLoop(); > + RunLoop::initializeMain(); Is there any reason that these are two separate function calls that both need to be called in each location? If JSC::initializeThreading called RunLoop::initializeMain, what would go wrong?
> > Source/WebKit/Shared/WebKit2Initialize.cpp:43 > > JSC::initializeThreading(); > > - RunLoop::initializeMainRunLoop(); > > + RunLoop::initializeMain(); > > Is there any reason that these are two separate function calls that both > need to be called in each location? If JSC::initializeThreading called > RunLoop::initializeMain, what would go wrong? JSC::initializeThreading can be called on any thread. RunLoop::initializeMain must be called on the main thread. But maybe we could add a JSC::initializeMain() convenience function to do both from the main thread.
Created attachment 401603 [details] Patch for landing
Committed r262878: <https://trac.webkit.org/changeset/262878> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401603 [details].
<rdar://problem/64231824>