Functions dispatched to WorkQueue are sometimes destroyed in the calling thread due to block refcounting A lot of dispatched lambdas are written with the expectation that the destruction of the lambda is done in the called thread. See discussion for r270876 as a example where time was spent debugging this. See git grep "dispatch(.*WTFMove.*{.*}" for subset of call sites that expect the WorkQueue to behave in different way.
Created attachment 431761 [details] Patch
Comment on attachment 431761 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431761&action=review > Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp:35 > +namespace { > +struct DispatchWorkItem { Could use an empty line here. > Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp:51 > + > + Extra empty line here.
Created attachment 431766 [details] Patch for landing
Created attachment 431836 [details] Patch for landing
Committed r279115 (239032@main): <https://commits.webkit.org/239032@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431836 [details].
<rdar://problem/79611008>