Bug 223049 - Introduce WorkQueue::dispatchSync()
Summary: Introduce WorkQueue::dispatchSync()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 223030
Blocks: 223073
  Show dependency treegraph
 
Reported: 2021-03-10 14:56 PST by Chris Dumez
Modified: 2021-03-11 10:01 PST (History)
11 users (show)

See Also:


Attachments
Patch (16.70 KB, patch)
2021-03-10 15:00 PST, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (16.63 KB, patch)
2021-03-10 17:34 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (16.76 KB, patch)
2021-03-11 08:15 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (16.72 KB, patch)
2021-03-11 08:40 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-03-10 14:56:37 PST
Introduce WorkQueue::dispatchSync(), which relies on GCD's dispatch_sync() internally on Cocoa ports.
Comment 1 Chris Dumez 2021-03-10 15:00:04 PST
Created attachment 422875 [details]
Patch
Comment 2 EWS Watchlist 2021-03-10 15:01:03 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Chris Dumez 2021-03-10 17:34:30 PST
Created attachment 422888 [details]
Patch
Comment 4 Alex Christensen 2021-03-11 07:44:57 PST
Comment on attachment 422888 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422888&action=review

> Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp:50
> +    dispatch_sync(m_dispatchQueue.get(), makeBlockPtr([protectedThis = makeRef(*this), function = WTFMove(function)] {

Do we need to protect this, since we won't return until the dispatch_sync returns?
Comment 5 Chris Dumez 2021-03-11 08:15:10 PST
Created attachment 422932 [details]
Patch
Comment 6 Alex Christensen 2021-03-11 08:39:10 PST
Comment on attachment 422932 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422932&action=review

> Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp:50
> +    dispatch_sync(m_dispatchQueue.get(), makeBlockPtr([function = WTFMove(function)] {

I don't think we need to make a lambda to wrap this function.
makeBlockPtr(WTFMove(function))
Comment 7 Chris Dumez 2021-03-11 08:40:44 PST
Created attachment 422936 [details]
Patch
Comment 8 EWS 2021-03-11 10:00:36 PST
Committed r274286: <https://commits.webkit.org/r274286>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422936 [details].
Comment 9 Radar WebKit Bug Importer 2021-03-11 10:01:30 PST
<rdar://problem/75320966>