Bug 226446 - Stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS in MediaRecorderPrivateWriter code
Summary: Stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS in MediaRecorderPrivateWriter code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-30 19:32 PDT by Chris Dumez
Modified: 2021-05-31 17:05 PDT (History)
12 users (show)

See Also:


Attachments
Patch (3.90 KB, patch)
2021-05-30 19:33 PDT, Chris Dumez
darin: review+
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-30 19:32:05 PDT
Stop using WTF_IGNORES_THREAD_SAFETY_ANALYSIS in MediaRecorderPrivateWriter code by refactoring the code slightly.
Comment 1 Chris Dumez 2021-05-30 19:33:25 PDT
Created attachment 430165 [details]
Patch
Comment 2 Darin Adler 2021-05-31 16:51:30 PDT
Comment on attachment 430165 [details]
Patch

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

> Source/WebCore/ChangeLog:10
> +        this thread safety checks do not apply to destructors.

"this" -> "since"

Seems like this doesn’t really make anything safer! Just quiets the compiler.
Comment 3 Chris Dumez 2021-05-31 17:01:32 PDT
Comment on attachment 430165 [details]
Patch

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

>> Source/WebCore/ChangeLog:10
>> +        this thread safety checks do not apply to destructors.
> 
> "this" -> "since"
> 
> Seems like this doesn’t really make anything safer! Just quiets the compiler.

I think it makes the code look safer. There is a reason clang doesn't apply threading checks to constructors and destructors: there is usually a single thread when those are executed.
I much prefer this than having a separate clear() function annotated with WTF_IGNORES_THREAD_SAFETY_ANALYSIS, which might get called from outside the destructor in the future, in an unsafe way.
Comment 4 Chris Dumez 2021-05-31 17:05:01 PDT
Committed r278286 (238323@main): <https://commits.webkit.org/238323@main>
Comment 5 Radar WebKit Bug Importer 2021-05-31 17:05:20 PDT
<rdar://problem/78695299>