RESOLVED FIXED 226255
Stop using UncheckedLock in WTF::AutomaticThread
https://bugs.webkit.org/show_bug.cgi?id=226255
Summary Stop using UncheckedLock in WTF::AutomaticThread
Chris Dumez
Reported 2021-05-25 19:35:23 PDT
Stop using UncheckedLock in WTF::AutomaticThread as it is being phased out in favor of Lock, which supports Clang thread safety analysis.
Attachments
Patch (20.20 KB, patch)
2021-05-25 19:41 PDT, Chris Dumez
no flags
Patch (22.66 KB, patch)
2021-05-25 20:09 PDT, Chris Dumez
no flags
Patch (22.69 KB, patch)
2021-05-25 20:13 PDT, Chris Dumez
no flags
Patch (23.08 KB, patch)
2021-05-26 08:11 PDT, Chris Dumez
no flags
Patch (20.91 KB, patch)
2021-05-26 09:42 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-05-25 19:41:19 PDT
Chris Dumez
Comment 2 2021-05-25 20:09:16 PDT
Chris Dumez
Comment 3 2021-05-25 20:13:00 PDT
Keith Miller
Comment 4 2021-05-26 08:04:08 PDT
Comment on attachment 429727 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429727&action=review > Source/WTF/wtf/ParallelHelperPool.cpp:189 > + assertIsHeld(*m_pool.m_lock); Why not just annotate the poll function? Or does this only work for locks that are a member of the same class as the method?
Chris Dumez
Comment 5 2021-05-26 08:06:40 PDT
Comment on attachment 429727 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429727&action=review >> Source/WTF/wtf/ParallelHelperPool.cpp:189 >> + assertIsHeld(*m_pool.m_lock); > > Why not just annotate the poll function? Or does this only work for locks that are a member of the same class as the method? I'll try. I think I already tried that and it didn't work but I don't really remember why.
Chris Dumez
Comment 6 2021-05-26 08:11:37 PDT
Chris Dumez
Comment 7 2021-05-26 08:12:10 PDT
(In reply to Keith Miller from comment #4) > Comment on attachment 429727 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=429727&action=review > > > Source/WTF/wtf/ParallelHelperPool.cpp:189 > > + assertIsHeld(*m_pool.m_lock); > > Why not just annotate the poll function? Or does this only work for locks > that are a member of the same class as the method? Looks like it builds without the assertIsHeld() and the annotation. Made the change.
Keith Miller
Comment 8 2021-05-26 08:19:17 PDT
(In reply to Chris Dumez from comment #7) > (In reply to Keith Miller from comment #4) > > Comment on attachment 429727 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=429727&action=review > > > > > Source/WTF/wtf/ParallelHelperPool.cpp:189 > > > + assertIsHeld(*m_pool.m_lock); > > > > Why not just annotate the poll function? Or does this only work for locks > > that are a member of the same class as the method? > > Looks like it builds without the assertIsHeld() and the annotation. Made the > change. Interesting, I'm surprised it's able to prove that no function changes the m_pool ref. Or maybe it makes the assumption that those values are constant? I guess the same thing would apply to the Box<Lock> that we pass to the AtomaticThread too.
Chris Dumez
Comment 9 2021-05-26 09:42:46 PDT
Chris Dumez
Comment 10 2021-05-26 09:46:45 PDT
Comment on attachment 429767 [details] Patch Clearing flags on attachment: 429767 Committed r278087 (238164@main): <https://commits.webkit.org/238164@main>
Chris Dumez
Comment 11 2021-05-26 09:46:48 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 12 2021-05-26 09:47:18 PDT
Note You need to log in before you can comment on or make changes to this bug.