<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[278069] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/278069">278069</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-05-25 17:37:19 -0700 (Tue, 25 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use UncheckedLock less in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=226212

Reviewed by Saam Barati.

Source/JavaScriptCore:

Use UncheckedLock less in JavaScriptCore as it is being phased out in favor of Lock, which
enables Clang thread safety analysis.

* assembler/testmasm.cpp:
* dfg/DFGCommon.cpp:
* dynbench.cpp:
* heap/Heap.cpp:
* heap/Heap.h:
* inspector/remote/socket/RemoteInspectorSocketEndpoint.h:
* runtime/JSLock.cpp:
* runtime/JSLock.h:
* runtime/VM.h:

Source/WTF:

Add support for unlockEarly() to Locker<Lock> specialization, for consistency
with the generic Locker.

* wtf/Lock.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblertestmasmcpp">trunk/Source/JavaScriptCore/assembler/testmasm.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGCommoncpp">trunk/Source/JavaScriptCore/dfg/DFGCommon.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredynbenchcpp">trunk/Source/JavaScriptCore/dynbench.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremotesocketRemoteInspectorSocketEndpointh">trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSLockcpp">trunk/Source/JavaScriptCore/runtime/JSLock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSLockh">trunk/Source/JavaScriptCore/runtime/JSLock.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfLockh">trunk/Source/WTF/wtf/Lock.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/ChangeLog       2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2021-05-25  Chris Dumez  <cdumez@apple.com>
+
+        Use UncheckedLock less in JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=226212
+
+        Reviewed by Saam Barati.
+
+        Use UncheckedLock less in JavaScriptCore as it is being phased out in favor of Lock, which
+        enables Clang thread safety analysis.
+
+        * assembler/testmasm.cpp:
+        * dfg/DFGCommon.cpp:
+        * dynbench.cpp:
+        * heap/Heap.cpp:
+        * heap/Heap.h:
+        * inspector/remote/socket/RemoteInspectorSocketEndpoint.h:
+        * runtime/JSLock.cpp:
+        * runtime/JSLock.h:
+        * runtime/VM.h:
+
</ins><span class="cx"> 2021-05-25  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblertestmasmcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/testmasm.cpp (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/testmasm.cpp       2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/assembler/testmasm.cpp  2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> 
</span><span class="cx"> using CPUState = Probe::CPUState;
</span><span class="cx"> 
</span><del>-UncheckedLock crashLock;
</del><ins>+Lock crashLock;
</ins><span class="cx"> 
</span><span class="cx"> typedef WTF::Function<void(CCallHelpers&)> Generator;
</span><span class="cx"> 
</span><span class="lines">@@ -2568,7 +2568,8 @@
</span><span class="cx">                 }));                            \
</span><span class="cx">     } while (false);
</span><span class="cx"> 
</span><del>-void run(const char* filter)
</del><ins>+// Using WTF_IGNORES_THREAD_SAFETY_ANALYSIS because the function is still holding crashLock when exiting.
+void run(const char* filter) WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     JSC::initialize();
</span><span class="cx">     unsigned numberOfTests = 0;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGCommon.cpp (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGCommon.cpp    2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/dfg/DFGCommon.cpp       2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -35,9 +35,10 @@
</span><span class="cx"> 
</span><span class="cx"> const char* const tierName = "DFG ";
</span><span class="cx"> 
</span><del>-static UncheckedLock crashLock;
</del><ins>+static Lock crashLock;
</ins><span class="cx"> 
</span><del>-void startCrashing()
</del><ins>+// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS since the function keeps holding the lock when returning.
+void startCrashing() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     crashLock.lock();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredynbenchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dynbench.cpp (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dynbench.cpp 2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/dynbench.cpp    2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace {
</span><span class="cx"> 
</span><del>-UncheckedLock crashLock;
</del><ins>+Lock crashLock;
</ins><span class="cx"> const char* nameFilter;
</span><span class="cx"> unsigned requestedIterationCount;
</span><span class="cx"> 
</span><span class="lines">@@ -69,7 +69,8 @@
</span><span class="cx"> 
</span><span class="cx"> } // anonymous namespace
</span><span class="cx"> 
</span><del>-int main(int argc, char** argv)
</del><ins>+// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because the function keeps holding crashLock when returning.
+int main(int argc, char** argv) WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     if (argc >= 2) {
</span><span class="cx">         if (argv[1][0] == '-') {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp   2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -2996,7 +2996,9 @@
</span><span class="cx">     dataLogIf(Options::logGC(), (MonotonicTime::now() - before).milliseconds(), "ms]\n");
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::preventCollection()
</del><ins>+// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because this function conditionally locks m_collectContinuouslyLock,
+// which is not supported by analysis.
+void Heap::preventCollection() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     if (!m_isSafeToCollect)
</span><span class="cx">         return;
</span><span class="lines">@@ -3015,7 +3017,9 @@
</span><span class="cx">     RELEASE_ASSERT(!m_collectionScope);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::allowCollection()
</del><ins>+// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because this function conditionally unlocks m_collectContinuouslyLock,
+// which is not supported by analysis.
+void Heap::allowCollection() WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     if (!m_isSafeToCollect)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h  2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/heap/Heap.h     2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -768,8 +768,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool m_parallelMarkersShouldExit { false };
</span><del>-    UncheckedLock m_collectContinuouslyLock;
-    UncheckedCondition m_collectContinuouslyCondition;
</del><ins>+    Lock m_collectContinuouslyLock;
+    Condition m_collectContinuouslyCondition;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremotesocketRemoteInspectorSocketEndpointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h      2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocketEndpoint.h 2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -182,9 +182,9 @@
</span><span class="cx">     bool isListening(ConnectionID);
</span><span class="cx">     int pollingTimeout();
</span><span class="cx"> 
</span><del>-    mutable UncheckedLock m_connectionsLock;
-    HashMap<ConnectionID, std::unique_ptr<ClientConnection>> m_clients;
-    HashMap<ConnectionID, std::unique_ptr<ListenerConnection>> m_listeners;
</del><ins>+    mutable Lock m_connectionsLock;
+    HashMap<ConnectionID, std::unique_ptr<ClientConnection>> m_clients WTF_GUARDED_BY_LOCK(m_connectionsLock);
+    HashMap<ConnectionID, std::unique_ptr<ListenerConnection>> m_listeners WTF_GUARDED_BY_LOCK(m_connectionsLock);
</ins><span class="cx"> 
</span><span class="cx">     PlatformSocketType m_wakeupSendSocket { INVALID_SOCKET_VALUE };
</span><span class="cx">     PlatformSocketType m_wakeupReceiveSocket { INVALID_SOCKET_VALUE };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.cpp (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.cpp   2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.cpp      2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -93,7 +93,9 @@
</span><span class="cx">     lock(1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSLock::lock(intptr_t lockCount)
</del><ins>+// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because this function conditionally unlocks m_lock, which
+// is not supported by analysis.
+void JSLock::lock(intptr_t lockCount) WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(lockCount > 0);
</span><span class="cx"> #if USE(WEB_THREAD)
</span><span class="lines">@@ -171,7 +173,9 @@
</span><span class="cx">     unlock(1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSLock::unlock(intptr_t unlockCount)
</del><ins>+// Use WTF_IGNORES_THREAD_SAFETY_ANALYSIS because this function conditionally unlocks m_lock, which
+// is not supported by analysis.
+void JSLock::unlock(intptr_t unlockCount) WTF_IGNORES_THREAD_SAFETY_ANALYSIS
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(currentThreadIsHoldingLock());
</span><span class="cx">     ASSERT(m_lockCount >= unlockCount);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.h (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.h     2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.h        2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">     unsigned dropAllLocks(DropAllLocks*);
</span><span class="cx">     void grabAllLocks(DropAllLocks*, unsigned lockCount);
</span><span class="cx"> 
</span><del>-    UncheckedLock m_lock;
</del><ins>+    Lock m_lock;
</ins><span class="cx">     bool m_isWebThreadAware { false };
</span><span class="cx">     // We cannot make m_ownerThread an optional (instead of pairing it with an explicit
</span><span class="cx">     // m_hasOwnerThread) because currentThreadIsHoldingLock() may be called from a
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h 2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/JavaScriptCore/runtime/VM.h    2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -1004,9 +1004,9 @@
</span><span class="cx"> #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
</span><span class="cx">     static constexpr size_t patternContextBufferSize = 8192; // Space allocated to save nested parenthesis context
</span><span class="cx">     UniqueArray<char> m_regExpPatternContexBuffer;
</span><del>-    UncheckedLock m_regExpPatternContextLock;
-    char* acquireRegExpPatternContexBuffer();
-    void releaseRegExpPatternContexBuffer();
</del><ins>+    Lock m_regExpPatternContextLock;
+    char* acquireRegExpPatternContexBuffer() WTF_ACQUIRES_LOCK(m_regExpPatternContextLock);
+    void releaseRegExpPatternContexBuffer() WTF_RELEASES_LOCK(m_regExpPatternContextLock);
</ins><span class="cx"> #else
</span><span class="cx">     static constexpr size_t patternContextBufferSize = 0; // Space allocated to save nested parenthesis context
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/WTF/ChangeLog  2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-05-25  Chris Dumez  <cdumez@apple.com>
+
+        Use UncheckedLock less in JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=226212
+
+        Reviewed by Saam Barati.
+
+        Add support for unlockEarly() to Locker<Lock> specialization, for consistency
+        with the generic Locker.
+
+        * wtf/Lock.h:
+
</ins><span class="cx"> 2021-05-25  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks
</span></span></pre></div>
<a id="trunkSourceWTFwtfLockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Lock.h (278068 => 278069)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Lock.h      2021-05-26 00:29:02 UTC (rev 278068)
+++ trunk/Source/WTF/wtf/Lock.h 2021-05-26 00:37:19 UTC (rev 278069)
</span><span class="lines">@@ -184,15 +184,24 @@
</span><span class="cx"> public:
</span><span class="cx">     explicit Locker(Lock& lock) WTF_ACQUIRES_LOCK(lock)
</span><span class="cx">         : m_lock(lock)
</span><ins>+        , m_isLocked(true)
</ins><span class="cx">     {
</span><span class="cx">         m_lock.lock();
</span><span class="cx">     }
</span><span class="cx">     Locker(AdoptLockTag, Lock& lock) WTF_REQUIRES_LOCK(lock)
</span><span class="cx">         : m_lock(lock)
</span><ins>+        , m_isLocked(true)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     ~Locker() WTF_RELEASES_LOCK()
</span><span class="cx">     {
</span><ins>+        if (m_isLocked)
+            m_lock.unlock();
+    }
+    void unlockEarly() WTF_RELEASES_LOCK()
+    {
+        ASSERT(m_isLocked);
+        m_isLocked = false;
</ins><span class="cx">         m_lock.unlock();
</span><span class="cx">     }
</span><span class="cx">     Locker(const Locker<Lock>&) = delete;
</span><span class="lines">@@ -216,6 +225,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Lock& m_lock;
</span><ins>+    bool m_isLocked { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> Locker(Lock&) -> Locker<Lock>;
</span></span></pre>
</div>
</div>

</body>
</html>