Bug 226431

Summary: Adopt clang thread safety annotations in WTF::DataMutex
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web Template FrameworkAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: aboya, achristensen, benjamin, calvaris, cgarcia, cmarcelo, darin, eric.carlson, ews-watchlist, ggaren, glenn, gustavo, jer.noble, mcatanzaro, menard, philipj, pnormand, sam, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 226432    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Chris Dumez 2021-05-29 20:01:42 PDT
Adopt clang thread safety annotation in WTF::DataMutex. This allows us to stop using UncheckedCondition in a few places.
Comment 1 Chris Dumez 2021-05-29 20:03:58 PDT
Created attachment 430122 [details]
Patch
Comment 2 Chris Dumez 2021-05-29 20:05:48 PDT
Created attachment 430123 [details]
Patch
Comment 3 Chris Dumez 2021-05-29 20:16:47 PDT
Created attachment 430124 [details]
Patch
Comment 4 Chris Dumez 2021-05-29 20:20:02 PDT
Created attachment 430125 [details]
Patch
Comment 5 Chris Dumez 2021-05-29 20:26:57 PDT
Created attachment 430126 [details]
Patch
Comment 6 EWS 2021-05-29 22:23:05 PDT
Committed r278248 (238285@main): <https://commits.webkit.org/238285@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430126 [details].
Comment 7 Radar WebKit Bug Importer 2021-05-29 22:24:22 PDT
<rdar://problem/78656465>
Comment 8 Alicia Boya GarcĂ­a 2021-06-03 04:03:48 PDT
Comment on attachment 430126 [details]
Patch

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

> Source/WTF/wtf/DataMutex.h:68
> +        DATA_MUTEX_CHECK(!mutex().isHeld());

Checking this *before* taking the mutex will crash in inocuous cases such when another thread has already locked the DataMutex and the calling thread needs to wait.