| Summary: | Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||||||||||||||||||||
| Component: | Web Template Framework | Assignee: | Chris Dumez <cdumez> | ||||||||||||||||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||||||||||||||||
| Severity: | Normal | CC: | achristensen, benjamin, berto, calvaris, cgarcia, changseok, cmarcelo, darin, ddkilzer, dino, eric.carlson, esprehn+autocc, ews-watchlist, ggaren, glenn, graouts, gustavo, gyuyoung.kim, hi, hta, jer.noble, joepeck, keith_miller, kkinnunen, kondapallykalyan, mark.lam, menard, msaboff, philipj, pnormand, saam, sam, sergio, tommyw, tzagallo, vjaquez, webkit-bug-importer | ||||||||||||||||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||||||||||||
| URL: | https://clang.llvm.org/docs/ThreadSafetyAnalysis.html | ||||||||||||||||||||||||||||||
| Bug Depends on: | |||||||||||||||||||||||||||||||
| Bug Blocks: | 226157 | ||||||||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||||||||
Created attachment 429429 [details]
Patch
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 Created attachment 429430 [details]
Patch
Created attachment 429432 [details]
Patch
Created attachment 429433 [details]
Patch
Created attachment 429436 [details]
Patch
Created attachment 429437 [details]
Patch
Created attachment 429439 [details]
Patch
Created attachment 429440 [details]
Patch
Not sure what's going on, it builds fine locally :/ Created attachment 429443 [details]
Patch
Created attachment 429446 [details]
Patch
Created attachment 429447 [details]
Patch
Created attachment 429448 [details]
Patch
Created attachment 429449 [details]
Patch
Comment on attachment 429449 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429449&action=review > Source/WTF/wtf/Locker.h:59 > +constexpr AdoptLockTag AdoptLock = AdoptLockTag(); I am surprised that we need the "= AdoptLockTag()" here. Can we omit it? (In reply to Darin Adler from comment #16) > Comment on attachment 429449 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=429449&action=review > > > Source/WTF/wtf/Locker.h:59 > > +constexpr AdoptLockTag AdoptLock = AdoptLockTag(); > > I am surprised that we need the "= AdoptLockTag()" here. Can we omit it? Will check and land without it if it builds. I had copied the definition from <mutex>: /* _LIBCPP_INLINE_VAR */ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); Committed r277932 (238062@main): <https://commits.webkit.org/238062@main> (In reply to Chris Dumez from comment #17) > (In reply to Darin Adler from comment #16) > > Comment on attachment 429449 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=429449&action=review > > > > > Source/WTF/wtf/Locker.h:59 > > > +constexpr AdoptLockTag AdoptLock = AdoptLockTag(); > > > > I am surprised that we need the "= AdoptLockTag()" here. Can we omit it? > > Will check and land without it if it builds. I had copied the definition > from <mutex>: > /* _LIBCPP_INLINE_VAR */ constexpr adopt_lock_t adopt_lock = > adopt_lock_t(); Yes, it built fine without it. |
Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis. Instead, use the following pattern: ``` Locker locker { DeferLock, m_lock }; if (locker.tryLock()) ```