RESOLVED FIXED 227160
Functions dispatched to WorkQueue are sometimes destroyed in the calling thread due to block refcounting
https://bugs.webkit.org/show_bug.cgi?id=227160
Summary Functions dispatched to WorkQueue are sometimes destroyed in the calling thre...
Kimmo Kinnunen
Reported 2021-06-18 01:00:07 PDT
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.
Attachments
Patch (9.48 KB, patch)
2021-06-18 01:30 PDT, Kimmo Kinnunen
no flags
Patch for landing (9.50 KB, patch)
2021-06-18 03:43 PDT, Kimmo Kinnunen
no flags
Patch for landing (10.02 KB, patch)
2021-06-21 01:12 PDT, Kimmo Kinnunen
no flags
Kimmo Kinnunen
Comment 1 2021-06-18 01:30:32 PDT
Antti Koivisto
Comment 2 2021-06-18 02:54:11 PDT
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.
Kimmo Kinnunen
Comment 3 2021-06-18 03:43:43 PDT
Created attachment 431766 [details] Patch for landing
Kimmo Kinnunen
Comment 4 2021-06-21 01:12:37 PDT
Created attachment 431836 [details] Patch for landing
EWS
Comment 5 2021-06-22 06:25:13 PDT
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].
Radar WebKit Bug Importer
Comment 6 2021-06-22 06:26:17 PDT
Note You need to log in before you can comment on or make changes to this bug.