[Webkit-unassigned] [Bug 209811] New: [WTF] DataMutex: Add runUnlocked()
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Mar 31 08:20:16 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=209811
Bug ID: 209811
Summary: [WTF] DataMutex: Add runUnlocked()
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: aboya at igalia.com
This patch introduces a runUnlocked() method in WTF::DataMutex::LockedWrapper
to run a lambda function without the lock. This is intended to be used for
small sections of the code that need to be unlocked, in cases where using
scoping would prove non-ergonomic or where running the unlocked section is only
necessary or desired when a certain condition is met -- something that cannot
be done with C++ scoping.
Safety mechanisms are provided. First, because this is used with a lambda, all
variables to be used in the unlocked section have to be specified in the
capture (global capture is possible but not recommended to simplify analysis).
Second, additional checks have been added to DataMutex to detect unlocked
accesses among other conditions. This will detect among other things naive
access to protected members by means of capturing the LockedWrapper by
reference.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200331/4a60a8e3/attachment-0001.htm>
More information about the webkit-unassigned
mailing list