| Summary: | Add a version of ThreadAssertions that treats UI and Web thread as the same | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Cameron McCormack (:heycam) <heycam> | ||||||
| Component: | Web Template Framework | Assignee: | Cameron McCormack (:heycam) <heycam> | ||||||
| Status: | NEW --- | ||||||||
| Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, ddkilzer, ews-watchlist, kkinnunen, simon.fraser, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Local Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=185330 | ||||||||
| Attachments: |
|
||||||||
|
Description
Cameron McCormack (:heycam)
2021-12-07 18:55:32 PST
Created attachment 446277 [details]
Patch
(In reply to Cameron McCormack (:heycam) from comment #0) > ThreadAssertions has so far been used exclusively within WebCore. That is completely false; it's been used exclusively within WebKit. Perhaps ThreadAssertions needs an option to choose whether to use isMainThread() for main thread checking. I thought I'd templatize ThreadAssertion with a parameter that indicates whether to use isMainThread() to check for main-threadedness, but that seemed to confuse clang into thinking the relevant capability was not acquired. Forthcoming patch just duplicates the ThreadAssertion class with this different behavior. Comments on a better name welcome. Created attachment 446283 [details]
Patch
Comment on attachment 446283 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446283&action=review > Source/WTF/wtf/ThreadAssertions.h:130 > would mainThread named assertion work for you instead? example in ThreadAssertionsTest.cpp Comment on attachment 446283 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446283&action=review > Source/WTF/wtf/ThreadAssertions.h:76 > +class WTF_CAPABILITY_LOCK MainOrOtherThreadAssertion { Could you name it as "SequenceAssertion". E.g. a "sequence" is a ..sequence.. where actions happen serially. (As implemented by a work queue, or gcd queue) |