Bug 226040 - Replace more static Locks with CheckedLocks in WTF / WebCore
Summary: Replace more static Locks with CheckedLocks in WTF / WebCore
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
: 226092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-20 12:55 PDT by Chris Dumez
Modified: 2021-05-21 13:20 PDT (History)
42 users (show)

See Also:


Attachments
Patch (132.39 KB, patch)
2021-05-20 14:00 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (130.29 KB, patch)
2021-05-20 17:40 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (126.99 KB, patch)
2021-05-20 18:20 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (124.35 KB, patch)
2021-05-20 18:29 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (96.86 KB, patch)
2021-05-21 10:21 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (110.80 KB, patch)
2021-05-21 10:51 PDT, 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-05-20 12:55:35 PDT
Replace more static Locks with CheckedLocks so that we can benefit from Clang Thread Safety Analysis.
Comment 1 Chris Dumez 2021-05-20 14:00:47 PDT
Created attachment 429218 [details]
Patch
Comment 2 Darin Adler 2021-05-20 17:05:12 PDT
Comment on attachment 429218 [details]
Patch

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

Not enough time to review it all right now, but one comment.

> Source/WTF/wtf/Language.cpp:98
> -    preferredLanguagesOverride() = override;
> +    {
> +        Locker locker { preferredLanguagesOverrideLock };
> +        preferredLanguagesOverride() = override;
> +    }

Is this fixing a bug? Have you been mixing in fixes with the "refactor to use the checker" patches before this?
Comment 3 Chris Dumez 2021-05-20 17:09:54 PDT
Comment on attachment 429218 [details]
Patch

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

>> Source/WTF/wtf/Language.cpp:98
>> +    }
> 
> Is this fixing a bug? Have you been mixing in fixes with the "refactor to use the checker" patches before this?

Yes, it is fixing a bug that was found by clang thanks to adopting CheckedLock. Yes, the CheckedLock patches I have landed include some fixes but not many. Mostly our code was correct (Thankfully).
Comment 4 Chris Dumez 2021-05-20 17:35:18 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 429218 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=429218&action=review
> 
> >> Source/WTF/wtf/Language.cpp:98
> >> +    }
> > 
> > Is this fixing a bug? Have you been mixing in fixes with the "refactor to use the checker" patches before this?
> 
> Yes, it is fixing a bug that was found by clang thanks to adopting
> CheckedLock. Yes, the CheckedLock patches I have landed include some fixes
> but not many. Mostly our code was correct (Thankfully).

I have split this fix to Bug 226059 to make it more obvious.
Comment 5 Chris Dumez 2021-05-20 17:40:21 PDT
Created attachment 429249 [details]
Patch
Comment 6 Chris Dumez 2021-05-20 18:20:45 PDT
Created attachment 429254 [details]
Patch
Comment 7 Chris Dumez 2021-05-20 18:29:34 PDT
Created attachment 429256 [details]
Patch
Comment 8 Chris Dumez 2021-05-20 18:32:25 PDT
Ok, I believe I have extracted all non-trivial bug fixes out into their own patches (see related bugs).
Comment 9 Chris Dumez 2021-05-21 10:21:45 PDT
Created attachment 429308 [details]
Patch
Comment 10 Chris Dumez 2021-05-21 10:49:04 PDT
*** Bug 226092 has been marked as a duplicate of this bug. ***
Comment 11 Chris Dumez 2021-05-21 10:51:03 PDT
Created attachment 429311 [details]
Patch
Comment 12 EWS 2021-05-21 13:19:53 PDT
Committed r277880 (238018@main): <https://commits.webkit.org/238018@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429311 [details].
Comment 13 Radar WebKit Bug Importer 2021-05-21 13:20:29 PDT
<rdar://problem/78324905>