Bug 185117 - Fixed a very unlikely race condition in WTF::WordLock
Summary: Fixed a very unlikely race condition in WTF::WordLock
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords: InRadar
: 185547 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-04-28 21:19 PDT by Geoffrey Garen
Modified: 2022-04-06 03:33 PDT (History)
10 users (show)

See Also:


Attachments
Patch (3.14 KB, patch)
2018-04-28 21:34 PDT, Geoffrey Garen
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2018-04-28 21:19:49 PDT
Fixed a very unlikely race condition in WTF::WordLock
Comment 1 Geoffrey Garen 2018-04-28 21:34:07 PDT
Created attachment 339088 [details]
Patch
Comment 2 Geoffrey Garen 2018-04-28 21:36:08 PDT
I'm not sure which arguments are best for LockSpeedTest. These results looked OK to me:

~/OpenSource> ./LockSpeedTest-baseline wordlock 1 4 10 20 40 2
WTFWordLock: 15528.899 KHz
WTFWordLock = {15528.899};
=====
~/OpenSource> ./LockSpeedTest wordlock 1 4 10 20 40 2
WTFWordLock: 15297.111 KHz
WTFWordLock = {15297.111};



~/OpenSource> ./LockSpeedTest-baseline wordlock 1 4 128 1024 40 2
WTFWordLock: 1505.704 KHz
WTFWordLock = {1505.704};
=====
~/OpenSource> ./LockSpeedTest wordlock 1 4 128 1024 40 2
WTFWordLock: 1499.678 KHz
WTFWordLock = {1499.678};
Comment 3 Geoffrey Garen 2018-04-28 21:42:51 PDT
Side note: ParkingLot does not have this bug. (It uses reference counting instead of the "lock more" solution I used here.)
Comment 4 Geoffrey Garen 2018-04-29 08:23:54 PDT
Committed r231148: <https://trac.webkit.org/changeset/231148>
Comment 5 Radar WebKit Bug Importer 2018-04-29 08:24:18 PDT
<rdar://problem/39824505>
Comment 6 Yusuke Suzuki 2022-04-06 03:33:01 PDT
*** Bug 185547 has been marked as a duplicate of this bug. ***