<!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>[225662] trunk</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/225662">225662</a></dd>
<dt>Author</dt> <dd>utatane.tea@gmail.com</dd>
<dt>Date</dt> <dd>2017-12-07 17:31:10 -0800 (Thu, 07 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use StaticLock instead of NeverDestroyed<Lock>
https://bugs.webkit.org/show_bug.cgi?id=180507

Reviewed by Saam Barati.

Source/WebCore:

StaticLock can be used instead of using NeverDestroyed<Lock>.

No behavior change.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::openDatabaseMutex):
(WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
(WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
(WebCore::DatabaseTracker::scheduleForNotification):
(WebCore::DatabaseTracker::notifyDatabasesChanged):
(WebCore::notificationMutex): Deleted.
* Modules/webdatabase/DatabaseTracker.h:
* platform/URL.cpp:
(WebCore::registerDefaultPortForProtocolForTesting):
(WebCore::clearDefaultPortForProtocolMapForTesting):
(WebCore::defaultPortForProtocol):
(WebCore::defaultPortForProtocolMapForTestingLock): Deleted.
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
(WebCore::installedMediaEngines):
(WebCore::MediaPlayer::resetMediaEngines):
(WebCore::mediaEngineVectorLock): Deleted.
* platform/ios/QuickLook.mm:
(WebCore::removeQLPreviewConverterForURL):
(WebCore::addQLPreviewConverterWithFileForURL):
(WebCore::qlPreviewConverterDictionaryMutex): Deleted.
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
(+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]):
(+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]):
(transactionBackgroundTaskIdentifierLock): Deleted.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlShareHandle::lockCallback):
(WebCore::CurlShareHandle::unlockCallback):
(WebCore::CurlShareHandle::mutexFor):
* platform/network/curl/CurlContext.h:

Source/WebKitLegacy/ios:

* WebCoreSupport/WebFixedPositionContent.mm:
(-[WebFixedPositionContent scrollOrZoomChanged:]):
(-[WebFixedPositionContent overflowScrollPositionForLayer:changedTo:]):
(-[WebFixedPositionContent setViewportConstrainedLayers:stickyContainerMap:]):
(-[WebFixedPositionContent hasFixedOrStickyPositionLayers]):
(WebFixedPositionContentDataLock): Deleted.

Source/WebKitLegacy/win:

* WebLocalizableStrings.cpp:
(findCachedString):
(cacheString):
(mainBundleLocStrings): Deleted.
(frameworkLocStringsMutex): Deleted.

Tools:

* DumpRenderTree/JavaScriptThreading.cpp:
(javaScriptThreads):
(runJavaScriptThread):
(startJavaScriptThreads):
(stopJavaScriptThreads):
(javaScriptThreadsMutex): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabasecpp">trunk/Source/WebCore/Modules/webdatabase/Database.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseTrackercpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseTrackerh">trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h</a></li>
<li><a href="#trunkSourceWebCoreplatformURLcpp">trunk/Source/WebCore/platform/URL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosQuickLookmm">trunk/Source/WebCore/platform/ios/QuickLook.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebSQLiteDatabaseTrackerClientmm">trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlContextcpp">trunk/Source/WebCore/platform/network/curl/CurlContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlContexth">trunk/Source/WebCore/platform/network/curl/CurlContext.h</a></li>
<li><a href="#trunkSourceWebKitLegacyiosChangeLog">trunk/Source/WebKitLegacy/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacyiosWebCoreSupportWebFixedPositionContentmm">trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacywinWebLocalizableStringscpp">trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeJavaScriptThreadingcpp">trunk/Tools/DumpRenderTree/JavaScriptThreading.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/ChangeLog      2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Use StaticLock instead of NeverDestroyed<Lock>
+        https://bugs.webkit.org/show_bug.cgi?id=180507
+
+        Reviewed by Saam Barati.
+
+        StaticLock can be used instead of using NeverDestroyed<Lock>.
+
+        No behavior change.
+
+        * Modules/webdatabase/Database.cpp:
+        (WebCore::Database::performOpenAndVerify):
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::openDatabaseMutex):
+        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
+        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
+        (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
+        (WebCore::DatabaseTracker::scheduleForNotification):
+        (WebCore::DatabaseTracker::notifyDatabasesChanged):
+        (WebCore::notificationMutex): Deleted.
+        * Modules/webdatabase/DatabaseTracker.h:
+        * platform/URL.cpp:
+        (WebCore::registerDefaultPortForProtocolForTesting):
+        (WebCore::clearDefaultPortForProtocolMapForTesting):
+        (WebCore::defaultPortForProtocol):
+        (WebCore::defaultPortForProtocolMapForTestingLock): Deleted.
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::buildMediaEnginesVector):
+        (WebCore::installedMediaEngines):
+        (WebCore::MediaPlayer::resetMediaEngines):
+        (WebCore::mediaEngineVectorLock): Deleted.
+        * platform/ios/QuickLook.mm:
+        (WebCore::removeQLPreviewConverterForURL):
+        (WebCore::addQLPreviewConverterWithFileForURL):
+        (WebCore::qlPreviewConverterDictionaryMutex): Deleted.
+        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
+        (+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]):
+        (+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]):
+        (transactionBackgroundTaskIdentifierLock): Deleted.
+        * platform/network/curl/CurlContext.cpp:
+        (WebCore::CurlShareHandle::lockCallback):
+        (WebCore::CurlShareHandle::unlockCallback):
+        (WebCore::CurlShareHandle::mutexFor):
+        * platform/network/curl/CurlContext.h:
+
</ins><span class="cx"> 2017-12-07  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Read registrations in from disk.
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp    2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp       2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -341,7 +341,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     {
</span><span class="cx">         // Make sure we wait till the background removal of the empty database files finished before trying to open any database.
</span><del>-        LockHolder locker(DatabaseTracker::openDatabaseMutex());
</del><ins>+        auto locker = holdLock(DatabaseTracker::openDatabaseMutex());
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseTrackercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp     2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp        2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -1275,10 +1275,10 @@
</span><span class="cx">     return SQLiteFileSystem::deleteDatabaseFile(path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Lock& DatabaseTracker::openDatabaseMutex()
</del><ins>+static StaticLock openDatabaseLock;
+StaticLock& DatabaseTracker::openDatabaseMutex()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed<Lock> mutex;
-    return mutex;
</del><ins>+    return openDatabaseLock;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled()
</span><span class="lines">@@ -1285,12 +1285,12 @@
</span><span class="cx"> {
</span><span class="cx">     // Lock the database from opening any database until we are done with scanning the file system for
</span><span class="cx">     // zero byte database files to remove.
</span><del>-    openDatabaseMutex().lock();
</del><ins>+    openDatabaseLock.lock();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish()
</span><span class="cx"> {
</span><del>-    openDatabaseMutex().unlock();
</del><ins>+    openDatabaseLock.unlock();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="lines">@@ -1300,11 +1300,7 @@
</span><span class="cx">     m_client = client;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Lock& notificationMutex()
-{
-    static NeverDestroyed<Lock> mutex;
-    return mutex;
-}
</del><ins>+static StaticLock notificationLock;
</ins><span class="cx"> 
</span><span class="cx"> using NotificationQueue = Vector<std::pair<SecurityOriginData, String>>;
</span><span class="cx"> 
</span><span class="lines">@@ -1316,7 +1312,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DatabaseTracker::scheduleNotifyDatabaseChanged(const SecurityOriginData& origin, const String& name)
</span><span class="cx"> {
</span><del>-    LockHolder locker(notificationMutex());
</del><ins>+    auto locker = holdLock(notificationLock);
</ins><span class="cx">     notificationQueue().append(std::make_pair(origin.isolatedCopy(), name.isolatedCopy()));
</span><span class="cx">     scheduleForNotification();
</span><span class="cx"> }
</span><span class="lines">@@ -1325,7 +1321,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DatabaseTracker::scheduleForNotification()
</span><span class="cx"> {
</span><del>-    ASSERT(!notificationMutex().tryLock());
</del><ins>+    ASSERT(!notificationLock.tryLock());
</ins><span class="cx"> 
</span><span class="cx">     if (!notificationScheduled) {
</span><span class="cx">         callOnMainThread([] {
</span><span class="lines">@@ -1343,7 +1339,7 @@
</span><span class="cx"> 
</span><span class="cx">     NotificationQueue notifications;
</span><span class="cx">     {
</span><del>-        LockHolder locker(notificationMutex());
</del><ins>+        auto locker = holdLock(notificationLock);
</ins><span class="cx">         notifications.swap(notificationQueue());
</span><span class="cx">         notificationScheduled = false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseTrackerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h       2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h  2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     // MobileSafari will grab this mutex on the main thread before dispatching the task to 
</span><span class="cx">     // clean up zero byte database files.  Any operations to open new database will have to
</span><span class="cx">     // wait for that task to finish by waiting on this mutex.
</span><del>-    static Lock& openDatabaseMutex();
</del><ins>+    static StaticLock& openDatabaseMutex();
</ins><span class="cx">     
</span><span class="cx">     WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskWillBeScheduled();
</span><span class="cx">     WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskDidFinish();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URL.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URL.cpp    2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/platform/URL.cpp       2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -275,11 +275,7 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static Lock& defaultPortForProtocolMapForTestingLock()
-{
-    static NeverDestroyed<Lock> lock;
-    return lock;
-}
</del><ins>+static StaticLock defaultPortForProtocolMapForTestingLock;
</ins><span class="cx"> 
</span><span class="cx"> using DefaultPortForProtocolMapForTesting = HashMap<String, uint16_t>;
</span><span class="cx"> static DefaultPortForProtocolMapForTesting*& defaultPortForProtocolMapForTesting()
</span><span class="lines">@@ -298,13 +294,13 @@
</span><span class="cx"> 
</span><span class="cx"> void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol)
</span><span class="cx"> {
</span><del>-    LockHolder locker(defaultPortForProtocolMapForTestingLock());
</del><ins>+    auto locker = holdLock(defaultPortForProtocolMapForTestingLock);
</ins><span class="cx">     ensureDefaultPortForProtocolMapForTesting().add(protocol, port);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void clearDefaultPortForProtocolMapForTesting()
</span><span class="cx"> {
</span><del>-    LockHolder locker(defaultPortForProtocolMapForTestingLock());
</del><ins>+    auto locker = holdLock(defaultPortForProtocolMapForTestingLock);
</ins><span class="cx">     if (auto* map = defaultPortForProtocolMapForTesting())
</span><span class="cx">         map->clear();
</span><span class="cx"> }
</span><span class="lines">@@ -312,7 +308,7 @@
</span><span class="cx"> std::optional<uint16_t> defaultPortForProtocol(StringView protocol)
</span><span class="cx"> {
</span><span class="cx">     if (auto* overrideMap = defaultPortForProtocolMapForTesting()) {
</span><del>-        LockHolder locker(defaultPortForProtocolMapForTestingLock());
</del><ins>+        auto locker = holdLock(defaultPortForProtocolMapForTestingLock);
</ins><span class="cx">         ASSERT(overrideMap); // No need to null check again here since overrideMap cannot become null after being non-null.
</span><span class="cx">         auto iterator = overrideMap->find(protocol.toStringWithoutCopying());
</span><span class="cx">         if (iterator != overrideMap->end())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp   2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp      2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -210,11 +210,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void addMediaEngine(CreateMediaEnginePlayer&&, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineOriginsInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForOrigins, MediaEngineSupportsKeySystem);
</span><span class="cx"> 
</span><del>-static Lock& mediaEngineVectorLock()
-{
-    static NeverDestroyed<Lock> lock;
-    return lock;
-}
</del><ins>+static StaticLock mediaEngineVectorLock;
</ins><span class="cx"> 
</span><span class="cx"> static bool& haveMediaEnginesVector()
</span><span class="cx"> {
</span><span class="lines">@@ -230,7 +226,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void buildMediaEnginesVector()
</span><span class="cx"> {
</span><del>-    ASSERT(mediaEngineVectorLock().isLocked());
</del><ins>+    ASSERT(mediaEngineVectorLock.isLocked());
</ins><span class="cx"> 
</span><span class="cx"> #if USE(AVFOUNDATION)
</span><span class="cx">     if (DeprecatedGlobalSettings::isAVFoundationEnabled()) {
</span><span class="lines">@@ -276,7 +272,7 @@
</span><span class="cx"> static const Vector<MediaPlayerFactory>& installedMediaEngines()
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        LockHolder lock(mediaEngineVectorLock());
</del><ins>+        auto locker = holdLock(mediaEngineVectorLock);
</ins><span class="cx">         if (!haveMediaEnginesVector())
</span><span class="cx">             buildMediaEnginesVector();
</span><span class="cx">     }
</span><span class="lines">@@ -1388,7 +1384,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayer::resetMediaEngines()
</span><span class="cx"> {
</span><del>-    LockHolder lock(mediaEngineVectorLock());
</del><ins>+    auto locker = holdLock(mediaEngineVectorLock);
</ins><span class="cx"> 
</span><span class="cx">     mutableInstalledMediaEnginesVector().clear();
</span><span class="cx">     haveMediaEnginesVector() = false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosQuickLookmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/QuickLook.mm (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/QuickLook.mm   2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/platform/ios/QuickLook.mm      2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -46,11 +46,7 @@
</span><span class="cx">     return set;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Lock& qlPreviewConverterDictionaryMutex()
-{
-    static NeverDestroyed<Lock> mutex;
-    return mutex;
-}
</del><ins>+static StaticLock qlPreviewConverterDictionaryLock;
</ins><span class="cx"> 
</span><span class="cx"> static NSMutableDictionary *QLPreviewConverterDictionary()
</span><span class="cx"> {
</span><span class="lines">@@ -66,7 +62,7 @@
</span><span class="cx"> 
</span><span class="cx"> void removeQLPreviewConverterForURL(NSURL *url)
</span><span class="cx"> {
</span><del>-    LockHolder lock(qlPreviewConverterDictionaryMutex());
</del><ins>+    auto locker = holdLock(qlPreviewConverterDictionaryLock);
</ins><span class="cx">     [QLPreviewConverterDictionary() removeObjectForKey:url];
</span><span class="cx">     [QLContentDictionary() removeObjectForKey:url];
</span><span class="cx"> }
</span><span class="lines">@@ -75,7 +71,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(url);
</span><span class="cx">     ASSERT(converter);
</span><del>-    LockHolder lock(qlPreviewConverterDictionaryMutex());
</del><ins>+    auto locker = holdLock(qlPreviewConverterDictionaryLock);
</ins><span class="cx">     [QLPreviewConverterDictionary() setObject:converter forKey:url];
</span><span class="cx">     [QLContentDictionary() setObject:(fileName ? fileName : @"") forKey:url];
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebSQLiteDatabaseTrackerClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm      2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm 2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -84,11 +84,7 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Lock& transactionBackgroundTaskIdentifierLock()
-{
-    static NeverDestroyed<Lock> mutex;
-    return mutex;
-}
</del><ins>+static StaticLock transactionBackgroundTaskIdentifierLock;
</ins><span class="cx"> 
</span><span class="cx"> static NSUInteger transactionBackgroundTaskIdentifier;
</span><span class="cx"> 
</span><span class="lines">@@ -111,7 +107,7 @@
</span><span class="cx"> 
</span><span class="cx"> + (void)startBackgroundTask
</span><span class="cx"> {
</span><del>-    LockHolder lock(transactionBackgroundTaskIdentifierLock());
</del><ins>+    auto locker = holdLock(transactionBackgroundTaskIdentifierLock);
</ins><span class="cx"> 
</span><span class="cx">     // If there's already an existing background task going on, there's no need to start a new one.
</span><span class="cx">     WebBackgroundTaskController *backgroundTaskController = [WebBackgroundTaskController sharedController];
</span><span class="lines">@@ -126,7 +122,7 @@
</span><span class="cx"> 
</span><span class="cx"> + (void)endBackgroundTask
</span><span class="cx"> {
</span><del>-    LockHolder lock(transactionBackgroundTaskIdentifierLock());
</del><ins>+    auto locker = holdLock(transactionBackgroundTaskIdentifierLock);
</ins><span class="cx"> 
</span><span class="cx">     // It is possible that we were unable to start the background task when the first transaction began.
</span><span class="cx">     // Don't try to end the task in that case.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlContext.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlContext.cpp       2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/platform/network/curl/CurlContext.cpp  2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -178,29 +178,29 @@
</span><span class="cx"> 
</span><span class="cx"> void CurlShareHandle::lockCallback(CURL*, curl_lock_data data, curl_lock_access, void*)
</span><span class="cx"> {
</span><del>-    if (Lock* mutex = mutexFor(data))
</del><ins>+    if (auto* mutex = mutexFor(data))
</ins><span class="cx">         mutex->lock();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CurlShareHandle::unlockCallback(CURL*, curl_lock_data data, void*)
</span><span class="cx"> {
</span><del>-    if (Lock* mutex = mutexFor(data))
</del><ins>+    if (auto* mutex = mutexFor(data))
</ins><span class="cx">         mutex->unlock();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Lock* CurlShareHandle::mutexFor(curl_lock_data data)
</del><ins>+StaticLock* CurlShareHandle::mutexFor(curl_lock_data data)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed<Lock> cookieMutex;
-    static NeverDestroyed<Lock> dnsMutex;
-    static NeverDestroyed<Lock> shareMutex;
</del><ins>+    static StaticLock cookieMutex;
+    static StaticLock dnsMutex;
+    static StaticLock shareMutex;
</ins><span class="cx"> 
</span><span class="cx">     switch (data) {
</span><span class="cx">     case CURL_LOCK_DATA_COOKIE:
</span><del>-        return &cookieMutex.get();
</del><ins>+        return &cookieMutex;
</ins><span class="cx">     case CURL_LOCK_DATA_DNS:
</span><del>-        return &dnsMutex.get();
</del><ins>+        return &dnsMutex;
</ins><span class="cx">     case CURL_LOCK_DATA_SHARE:
</span><del>-        return &shareMutex.get();
</del><ins>+        return &shareMutex;
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlContext.h (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlContext.h 2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebCore/platform/network/curl/CurlContext.h    2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> private:
</span><span class="cx">     static void lockCallback(CURL*, curl_lock_data, curl_lock_access, void*);
</span><span class="cx">     static void unlockCallback(CURL*, curl_lock_data, void*);
</span><del>-    static Lock* mutexFor(curl_lock_data);
</del><ins>+    static StaticLock* mutexFor(curl_lock_data);
</ins><span class="cx"> 
</span><span class="cx">     CURLSH* m_shareHandle { nullptr };
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/ChangeLog  2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog     2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Use StaticLock instead of NeverDestroyed<Lock>
+        https://bugs.webkit.org/show_bug.cgi?id=180507
+
+        Reviewed by Saam Barati.
+
+        * WebCoreSupport/WebFixedPositionContent.mm:
+        (-[WebFixedPositionContent scrollOrZoomChanged:]):
+        (-[WebFixedPositionContent overflowScrollPositionForLayer:changedTo:]):
+        (-[WebFixedPositionContent setViewportConstrainedLayers:stickyContainerMap:]):
+        (-[WebFixedPositionContent hasFixedOrStickyPositionLayers]):
+        (WebFixedPositionContentDataLock): Deleted.
+
</ins><span class="cx"> 2017-11-11  Megan Gardner  <megan_gardner@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Fix a FIXMEs in WebFrameIOS
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosWebCoreSupportWebFixedPositionContentmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm  2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm     2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -49,11 +49,7 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><del>-static Lock& WebFixedPositionContentDataLock()
-{
-    static NeverDestroyed<Lock> mutex;
-    return mutex;
-}
</del><ins>+static StaticLock webFixedPositionContentDataLock;
</ins><span class="cx"> 
</span><span class="cx"> struct ViewportConstrainedLayerData {
</span><span class="cx">     ViewportConstrainedLayerData()
</span><span class="lines">@@ -104,7 +100,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollOrZoomChanged:(CGRect)positionedObjectsRect
</span><span class="cx"> {
</span><del>-    LockHolder lock(WebFixedPositionContentDataLock());
</del><ins>+    auto locker = holdLock(webFixedPositionContentDataLock);
</ins><span class="cx"> 
</span><span class="cx">     LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
</span><span class="cx">     for (LayerInfoMap::const_iterator it = _private->m_viewportConstrainedLayers.begin(); it != end; ++it) {
</span><span class="lines">@@ -143,7 +139,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)overflowScrollPositionForLayer:(CALayer *)scrollLayer changedTo:(CGPoint)scrollPosition
</span><span class="cx"> {
</span><del>-    LockHolder lock(WebFixedPositionContentDataLock());
</del><ins>+    auto locker = holdLock(webFixedPositionContentDataLock);
</ins><span class="cx"> 
</span><span class="cx">     LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
</span><span class="cx">     for (LayerInfoMap::const_iterator it = _private->m_viewportConstrainedLayers.begin(); it != end; ++it) {
</span><span class="lines">@@ -176,7 +172,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, std::unique_ptr<WebCore::ViewportConstraints>>&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers
</span><span class="cx"> {
</span><del>-    LockHolder lock(WebFixedPositionContentDataLock());
</del><ins>+    auto locker = holdLock(webFixedPositionContentDataLock);
</ins><span class="cx"> 
</span><span class="cx">     _private->m_viewportConstrainedLayers.clear();
</span><span class="cx"> 
</span><span class="lines">@@ -193,7 +189,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)hasFixedOrStickyPositionLayers
</span><span class="cx"> {
</span><del>-    LockHolder lock(WebFixedPositionContentDataLock());
</del><ins>+    auto locker = holdLock(webFixedPositionContentDataLock);
</ins><span class="cx">     return !_private->m_viewportConstrainedLayers.isEmpty();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Use StaticLock instead of NeverDestroyed<Lock>
+        https://bugs.webkit.org/show_bug.cgi?id=180507
+
+        Reviewed by Saam Barati.
+
+        * WebLocalizableStrings.cpp:
+        (findCachedString):
+        (cacheString):
+        (mainBundleLocStrings): Deleted.
+        (frameworkLocStringsMutex): Deleted.
+
</ins><span class="cx"> 2017-12-05  Per Arne Vollan  <pvollan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Win] Scrollbars are sometimes not rendered in accelerated compositing mode.
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinWebLocalizableStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp  2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp     2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -45,11 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> typedef HashMap<String, LocalizedString*> LocalizedStringMap;
</span><span class="cx"> 
</span><del>-static Lock& mainBundleLocStringsMutex()
-{
-    static NeverDestroyed<Lock> mutex;
-    return mutex;
-}
</del><ins>+static StaticLock mainBundleLocStringsLock;
</ins><span class="cx"> 
</span><span class="cx"> static LocalizedStringMap& mainBundleLocStrings()
</span><span class="cx"> {
</span><span class="lines">@@ -57,11 +53,7 @@
</span><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Lock& frameworkLocStringsMutex()
-{
-    static NeverDestroyed<Lock> mutex;
-    return mutex;
-}
</del><ins>+static StaticLock frameworkLocStringsLock;
</ins><span class="cx"> 
</span><span class="cx"> static LocalizedStringMap frameworkLocStrings()
</span><span class="cx"> {
</span><span class="lines">@@ -176,12 +168,12 @@
</span><span class="cx"> static LocalizedString* findCachedString(WebLocalizableStringsBundle* stringsBundle, const String& key)
</span><span class="cx"> {
</span><span class="cx">     if (!stringsBundle) {
</span><del>-        LockHolder lock(mainBundleLocStringsMutex());
</del><ins>+        auto locker = holdLock(mainBundleLocStringsLock);
</ins><span class="cx">         return mainBundleLocStrings().get(key);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (stringsBundle->bundle == WebKitLocalizableStringsBundle.bundle) {
</span><del>-        LockHolder lock(frameworkLocStringsMutex());
</del><ins>+        auto locker = holdLock(frameworkLocStringsLock);
</ins><span class="cx">         return frameworkLocStrings().get(key);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -191,12 +183,12 @@
</span><span class="cx"> static void cacheString(WebLocalizableStringsBundle* stringsBundle, const String& key, LocalizedString* value)
</span><span class="cx"> {
</span><span class="cx">     if (!stringsBundle) {
</span><del>-        LockHolder lock(mainBundleLocStringsMutex());
</del><ins>+        auto locker = holdLock(mainBundleLocStringsLock);
</ins><span class="cx">         mainBundleLocStrings().set(key, value);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    LockHolder lock(frameworkLocStringsMutex());
</del><ins>+    auto locker = holdLock(frameworkLocStringsLock);
</ins><span class="cx">     frameworkLocStrings().set(key, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Tools/ChangeLog       2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Use StaticLock instead of NeverDestroyed<Lock>
+        https://bugs.webkit.org/show_bug.cgi?id=180507
+
+        Reviewed by Saam Barati.
+
+        * DumpRenderTree/JavaScriptThreading.cpp:
+        (javaScriptThreads):
+        (runJavaScriptThread):
+        (startJavaScriptThreads):
+        (stopJavaScriptThreads):
+        (javaScriptThreadsMutex): Deleted.
+
</ins><span class="cx"> 2017-12-07  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Always synchronously continue with fragment navigations
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeJavaScriptThreadingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/JavaScriptThreading.cpp (225661 => 225662)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/JavaScriptThreading.cpp       2017-12-08 01:27:00 UTC (rev 225661)
+++ trunk/Tools/DumpRenderTree/JavaScriptThreading.cpp  2017-12-08 01:31:10 UTC (rev 225662)
</span><span class="lines">@@ -45,18 +45,13 @@
</span><span class="cx"> static const size_t javaScriptThreadsCount = 4;
</span><span class="cx"> static bool javaScriptThreadsShouldTerminate;
</span><span class="cx"> static JSContextGroupRef javaScriptThreadsGroup;
</span><ins>+static StaticLock javaScriptThreadsLock;
</ins><span class="cx"> 
</span><del>-static Lock& javaScriptThreadsMutex()
-{
-    static NeverDestroyed<Lock> staticMutex;
-    return staticMutex;
-}
-
</del><span class="cx"> typedef HashSet<RefPtr<Thread>> ThreadSet;
</span><span class="cx"> static ThreadSet& javaScriptThreads()
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed<ThreadSet> staticJavaScriptThreads;
</span><del>-    ASSERT(!javaScriptThreadsMutex().tryLock());
</del><ins>+    ASSERT(!javaScriptThreadsLock.tryLock());
</ins><span class="cx">     return staticJavaScriptThreads;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -72,19 +67,19 @@
</span><span class="cx"> 
</span><span class="cx">     JSGlobalContextRef ctx;
</span><span class="cx">     {
</span><del>-        LockHolder locker(javaScriptThreadsMutex());
</del><ins>+        auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">         ctx = JSGlobalContextCreateInGroup(javaScriptThreadsGroup, 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSStringRef scriptRef;
</span><span class="cx">     {
</span><del>-        LockHolder locker(javaScriptThreadsMutex());
</del><ins>+        auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">         scriptRef = JSStringCreateWithUTF8CString(script);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     while (true) {
</span><span class="cx">         {
</span><del>-            LockHolder locker(javaScriptThreadsMutex());
</del><ins>+            auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">             JSValueRef exception = 0;
</span><span class="cx">             JSEvaluateScript(ctx, scriptRef, 0, 0, 1, &exception);
</span><span class="cx">             ASSERT(!exception);
</span><span class="lines">@@ -91,7 +86,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         {
</span><del>-            LockHolder locker(javaScriptThreadsMutex());
</del><ins>+            auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">             const size_t valuesCount = 1024;
</span><span class="cx">             JSValueRef values[valuesCount];
</span><span class="cx">             for (size_t i = 0; i < valuesCount; ++i)
</span><span class="lines">@@ -99,7 +94,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         {
</span><del>-            LockHolder locker(javaScriptThreadsMutex());
</del><ins>+            auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">             if (javaScriptThreadsShouldTerminate)
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="lines">@@ -108,7 +103,7 @@
</span><span class="cx">         if (rand() % 5)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        LockHolder locker(javaScriptThreadsMutex());
</del><ins>+        auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">         Thread& thread = Thread::current();
</span><span class="cx">         thread.detach();
</span><span class="cx">         javaScriptThreads().remove(&thread);
</span><span class="lines">@@ -116,7 +111,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    LockHolder locker(javaScriptThreadsMutex());
</del><ins>+    auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">     JSStringRelease(scriptRef);
</span><span class="cx">     JSGarbageCollect(ctx);
</span><span class="cx">     JSGlobalContextRelease(ctx);
</span><span class="lines">@@ -126,7 +121,7 @@
</span><span class="cx"> {
</span><span class="cx">     javaScriptThreadsGroup = JSContextGroupCreate();
</span><span class="cx"> 
</span><del>-    LockHolder locker(javaScriptThreadsMutex());
</del><ins>+    auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i < javaScriptThreadsCount; ++i)
</span><span class="cx">         javaScriptThreads().add(Thread::create("JavaScript Thread", &runJavaScriptThread));
</span><span class="lines">@@ -135,13 +130,13 @@
</span><span class="cx"> void stopJavaScriptThreads()
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        LockHolder locker(javaScriptThreadsMutex());
</del><ins>+        auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">         javaScriptThreadsShouldTerminate = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector<RefPtr<Thread>, javaScriptThreadsCount> threads;
</span><span class="cx">     {
</span><del>-        LockHolder locker(javaScriptThreadsMutex());
</del><ins>+        auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">         threads = copyToVector(javaScriptThreads());
</span><span class="cx">         ASSERT(threads.size() == javaScriptThreadsCount);
</span><span class="cx">     }
</span><span class="lines">@@ -150,7 +145,7 @@
</span><span class="cx">         threads[i]->waitForCompletion();
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        LockHolder locker(javaScriptThreadsMutex());
</del><ins>+        auto locker = holdLock(javaScriptThreadsLock);
</ins><span class="cx">         javaScriptThreads().clear();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>