Simplify main thread initialization on macOS by always using pthread main as main thread.
Created attachment 381011 [details] Patch
Created attachment 381012 [details] Patch
Comment on attachment 381012 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381012&action=review r=me > Source/WTF/ChangeLog:10 > + Probably worth mentioning that this change also enables the new white box ASSERT that we don't initialize main thread to some other thread. > Source/WebKitLegacy/mac/Misc/WebCache.mm:-68 > JSC::initializeThreading(); > - WTF::initializeMainThreadToProcessMainThread(); In cases like this, is it OK to call JSC::initializeThreading() and not WTF::initializeMainThreadToProcessMainThread
> > Source/WebKitLegacy/mac/Misc/WebCache.mm:-68 > > JSC::initializeThreading(); > > - WTF::initializeMainThreadToProcessMainThread(); > > In cases like this, is it OK to call JSC::initializeThreading() and not > WTF::initializeMainThreadToProcessMainThread I verified that JSC::initializeThreading(); calls WTF::initializeThreading(), so it's OK.
Comment on attachment 381012 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381012&action=review >> Source/WTF/ChangeLog:10 >> + > > Probably worth mentioning that this change also enables the new white box ASSERT that we don't initialize main thread to some other thread. Will add. >> Source/WebKitLegacy/mac/Misc/WebCache.mm:-68 >> - WTF::initializeMainThreadToProcessMainThread(); > > In cases like this, is it OK to call JSC::initializeThreading() and not WTF::initializeMainThreadToProcessMainThread I dropped it because RunLoop::initializeMainRunLoop() below calls WTF::initializeMainThread(); With my change, WTF::initializeMainThread() became identical to WTF::initializeMainThreadToProcessMainThread() so I dropped the latter.
Created attachment 381026 [details] Patch
Comment on attachment 381026 [details] Patch Clearing flags on attachment: 381026 Committed r251164: <https://trac.webkit.org/changeset/251164>
All reviewed patches have been landed. Closing bug.
This patch broke builds: ld: warning: directory not found for option '-F/Volumes/Data/slave/highsierra-debug/build/Tools/TestWebKitAPI/../../WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101300' Undefined symbols for architecture x86_64: "WTF::isMainThreadIfInitialized()", referenced from: WTF::RefCountedBase::applyRefDerefThreadingCheck() const in libTestWebKitAPI.a(EnvironmentUtilitiesTest.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Not sure why EWS didn't catch it.
Hm... I wonder if we just need a clean build?
(In reply to Ryosuke Niwa from comment #10) > Hm... I wonder if we just need a clean build? Sounds likely.
(In reply to Chris Dumez from comment #11) > (In reply to Ryosuke Niwa from comment #10) > > Hm... I wonder if we just need a clean build? > > Sounds likely. Indeed, clean build fixed the issue for me.
<rdar://problem/56313281>