Changeset 225662 in webkit


Ignore:
Timestamp:
Dec 7, 2017 5:31:10 PM (6 years ago)
Author:
Yusuke Suzuki
Message:

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.

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r225661 r225662  
     12017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        Use StaticLock instead of NeverDestroyed<Lock>
     4        https://bugs.webkit.org/show_bug.cgi?id=180507
     5
     6        Reviewed by Saam Barati.
     7
     8        StaticLock can be used instead of using NeverDestroyed<Lock>.
     9
     10        No behavior change.
     11
     12        * Modules/webdatabase/Database.cpp:
     13        (WebCore::Database::performOpenAndVerify):
     14        * Modules/webdatabase/DatabaseTracker.cpp:
     15        (WebCore::DatabaseTracker::openDatabaseMutex):
     16        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
     17        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
     18        (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
     19        (WebCore::DatabaseTracker::scheduleForNotification):
     20        (WebCore::DatabaseTracker::notifyDatabasesChanged):
     21        (WebCore::notificationMutex): Deleted.
     22        * Modules/webdatabase/DatabaseTracker.h:
     23        * platform/URL.cpp:
     24        (WebCore::registerDefaultPortForProtocolForTesting):
     25        (WebCore::clearDefaultPortForProtocolMapForTesting):
     26        (WebCore::defaultPortForProtocol):
     27        (WebCore::defaultPortForProtocolMapForTestingLock): Deleted.
     28        * platform/graphics/MediaPlayer.cpp:
     29        (WebCore::buildMediaEnginesVector):
     30        (WebCore::installedMediaEngines):
     31        (WebCore::MediaPlayer::resetMediaEngines):
     32        (WebCore::mediaEngineVectorLock): Deleted.
     33        * platform/ios/QuickLook.mm:
     34        (WebCore::removeQLPreviewConverterForURL):
     35        (WebCore::addQLPreviewConverterWithFileForURL):
     36        (WebCore::qlPreviewConverterDictionaryMutex): Deleted.
     37        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
     38        (+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]):
     39        (+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]):
     40        (transactionBackgroundTaskIdentifierLock): Deleted.
     41        * platform/network/curl/CurlContext.cpp:
     42        (WebCore::CurlShareHandle::lockCallback):
     43        (WebCore::CurlShareHandle::unlockCallback):
     44        (WebCore::CurlShareHandle::mutexFor):
     45        * platform/network/curl/CurlContext.h:
     46
    1472017-12-07  Brady Eidson  <beidson@apple.com>
    248
  • trunk/Source/WebCore/Modules/webdatabase/Database.cpp

    r225470 r225662  
    342342    {
    343343        // Make sure we wait till the background removal of the empty database files finished before trying to open any database.
    344         LockHolder locker(DatabaseTracker::openDatabaseMutex());
     344        auto locker = holdLock(DatabaseTracker::openDatabaseMutex());
    345345    }
    346346#endif
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp

    r224371 r225662  
    12761276}
    12771277
    1278 Lock& DatabaseTracker::openDatabaseMutex()
    1279 {
    1280     static NeverDestroyed<Lock> mutex;
    1281     return mutex;
     1278static StaticLock openDatabaseLock;
     1279StaticLock& DatabaseTracker::openDatabaseMutex()
     1280{
     1281    return openDatabaseLock;
    12821282}
    12831283
     
    12861286    // Lock the database from opening any database until we are done with scanning the file system for
    12871287    // zero byte database files to remove.
    1288     openDatabaseMutex().lock();
     1288    openDatabaseLock.lock();
    12891289}
    12901290
    12911291void DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish()
    12921292{
    1293     openDatabaseMutex().unlock();
     1293    openDatabaseLock.unlock();
    12941294}
    12951295
     
    13011301}
    13021302
    1303 static Lock& notificationMutex()
    1304 {
    1305     static NeverDestroyed<Lock> mutex;
    1306     return mutex;
    1307 }
     1303static StaticLock notificationLock;
    13081304
    13091305using NotificationQueue = Vector<std::pair<SecurityOriginData, String>>;
     
    13171313void DatabaseTracker::scheduleNotifyDatabaseChanged(const SecurityOriginData& origin, const String& name)
    13181314{
    1319     LockHolder locker(notificationMutex());
     1315    auto locker = holdLock(notificationLock);
    13201316    notificationQueue().append(std::make_pair(origin.isolatedCopy(), name.isolatedCopy()));
    13211317    scheduleForNotification();
     
    13261322void DatabaseTracker::scheduleForNotification()
    13271323{
    1328     ASSERT(!notificationMutex().tryLock());
     1324    ASSERT(!notificationLock.tryLock());
    13291325
    13301326    if (!notificationScheduled) {
     
    13441340    NotificationQueue notifications;
    13451341    {
    1346         LockHolder locker(notificationMutex());
     1342        auto locker = holdLock(notificationLock);
    13471343        notifications.swap(notificationQueue());
    13481344        notificationScheduled = false;
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h

    r223427 r225662  
    101101    // clean up zero byte database files.  Any operations to open new database will have to
    102102    // wait for that task to finish by waiting on this mutex.
    103     static Lock& openDatabaseMutex();
     103    static StaticLock& openDatabaseMutex();
    104104   
    105105    WEBCORE_EXPORT static void emptyDatabaseFilesRemovalTaskWillBeScheduled();
  • trunk/Source/WebCore/platform/URL.cpp

    r225117 r225662  
    276276#endif
    277277
    278 static Lock& defaultPortForProtocolMapForTestingLock()
    279 {
    280     static NeverDestroyed<Lock> lock;
    281     return lock;
    282 }
     278static StaticLock defaultPortForProtocolMapForTestingLock;
    283279
    284280using DefaultPortForProtocolMapForTesting = HashMap<String, uint16_t>;
     
    299295void registerDefaultPortForProtocolForTesting(uint16_t port, const String& protocol)
    300296{
    301     LockHolder locker(defaultPortForProtocolMapForTestingLock());
     297    auto locker = holdLock(defaultPortForProtocolMapForTestingLock);
    302298    ensureDefaultPortForProtocolMapForTesting().add(protocol, port);
    303299}
     
    305301void clearDefaultPortForProtocolMapForTesting()
    306302{
    307     LockHolder locker(defaultPortForProtocolMapForTestingLock());
     303    auto locker = holdLock(defaultPortForProtocolMapForTestingLock);
    308304    if (auto* map = defaultPortForProtocolMapForTesting())
    309305        map->clear();
     
    313309{
    314310    if (auto* overrideMap = defaultPortForProtocolMapForTesting()) {
    315         LockHolder locker(defaultPortForProtocolMapForTestingLock());
     311        auto locker = holdLock(defaultPortForProtocolMapForTestingLock);
    316312        ASSERT(overrideMap); // No need to null check again here since overrideMap cannot become null after being non-null.
    317313        auto iterator = overrideMap->find(protocol.toStringWithoutCopying());
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r225594 r225662  
    211211static void addMediaEngine(CreateMediaEnginePlayer&&, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineOriginsInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForOrigins, MediaEngineSupportsKeySystem);
    212212
    213 static Lock& mediaEngineVectorLock()
    214 {
    215     static NeverDestroyed<Lock> lock;
    216     return lock;
    217 }
     213static StaticLock mediaEngineVectorLock;
    218214
    219215static bool& haveMediaEnginesVector()
     
    231227static void buildMediaEnginesVector()
    232228{
    233     ASSERT(mediaEngineVectorLock().isLocked());
     229    ASSERT(mediaEngineVectorLock.isLocked());
    234230
    235231#if USE(AVFOUNDATION)
     
    277273{
    278274    {
    279         LockHolder lock(mediaEngineVectorLock());
     275        auto locker = holdLock(mediaEngineVectorLock);
    280276        if (!haveMediaEnginesVector())
    281277            buildMediaEnginesVector();
     
    13891385void MediaPlayer::resetMediaEngines()
    13901386{
    1391     LockHolder lock(mediaEngineVectorLock());
     1387    auto locker = holdLock(mediaEngineVectorLock);
    13921388
    13931389    mutableInstalledMediaEnginesVector().clear();
  • trunk/Source/WebCore/platform/ios/QuickLook.mm

    r224371 r225662  
    4747}
    4848
    49 static Lock& qlPreviewConverterDictionaryMutex()
    50 {
    51     static NeverDestroyed<Lock> mutex;
    52     return mutex;
    53 }
     49static StaticLock qlPreviewConverterDictionaryLock;
    5450
    5551static NSMutableDictionary *QLPreviewConverterDictionary()
     
    6763void removeQLPreviewConverterForURL(NSURL *url)
    6864{
    69     LockHolder lock(qlPreviewConverterDictionaryMutex());
     65    auto locker = holdLock(qlPreviewConverterDictionaryLock);
    7066    [QLPreviewConverterDictionary() removeObjectForKey:url];
    7167    [QLContentDictionary() removeObjectForKey:url];
     
    7672    ASSERT(url);
    7773    ASSERT(converter);
    78     LockHolder lock(qlPreviewConverterDictionaryMutex());
     74    auto locker = holdLock(qlPreviewConverterDictionaryLock);
    7975    [QLPreviewConverterDictionary() setObject:converter forKey:url];
    8076    [QLContentDictionary() setObject:(fileName ? fileName : @"") forKey:url];
  • trunk/Source/WebCore/platform/ios/WebSQLiteDatabaseTrackerClient.mm

    r224452 r225662  
    8585}
    8686
    87 static Lock& transactionBackgroundTaskIdentifierLock()
    88 {
    89     static NeverDestroyed<Lock> mutex;
    90     return mutex;
    91 }
     87static StaticLock transactionBackgroundTaskIdentifierLock;
    9288
    9389static NSUInteger transactionBackgroundTaskIdentifier;
     
    112108+ (void)startBackgroundTask
    113109{
    114     LockHolder lock(transactionBackgroundTaskIdentifierLock());
     110    auto locker = holdLock(transactionBackgroundTaskIdentifierLock);
    115111
    116112    // If there's already an existing background task going on, there's no need to start a new one.
     
    127123+ (void)endBackgroundTask
    128124{
    129     LockHolder lock(transactionBackgroundTaskIdentifierLock());
     125    auto locker = holdLock(transactionBackgroundTaskIdentifierLock);
    130126
    131127    // It is possible that we were unable to start the background task when the first transaction began.
  • trunk/Source/WebCore/platform/network/curl/CurlContext.cpp

    r223838 r225662  
    179179void CurlShareHandle::lockCallback(CURL*, curl_lock_data data, curl_lock_access, void*)
    180180{
    181     if (Lock* mutex = mutexFor(data))
     181    if (auto* mutex = mutexFor(data))
    182182        mutex->lock();
    183183}
     
    185185void CurlShareHandle::unlockCallback(CURL*, curl_lock_data data, void*)
    186186{
    187     if (Lock* mutex = mutexFor(data))
     187    if (auto* mutex = mutexFor(data))
    188188        mutex->unlock();
    189189}
    190190
    191 Lock* CurlShareHandle::mutexFor(curl_lock_data data)
    192 {
    193     static NeverDestroyed<Lock> cookieMutex;
    194     static NeverDestroyed<Lock> dnsMutex;
    195     static NeverDestroyed<Lock> shareMutex;
     191StaticLock* CurlShareHandle::mutexFor(curl_lock_data data)
     192{
     193    static StaticLock cookieMutex;
     194    static StaticLock dnsMutex;
     195    static StaticLock shareMutex;
    196196
    197197    switch (data) {
    198198    case CURL_LOCK_DATA_COOKIE:
    199         return &cookieMutex.get();
     199        return &cookieMutex;
    200200    case CURL_LOCK_DATA_DNS:
    201         return &dnsMutex.get();
     201        return &dnsMutex;
    202202    case CURL_LOCK_DATA_SHARE:
    203         return &shareMutex.get();
     203        return &shareMutex;
    204204    default:
    205205        ASSERT_NOT_REACHED();
  • trunk/Source/WebCore/platform/network/curl/CurlContext.h

    r223752 r225662  
    8484    static void lockCallback(CURL*, curl_lock_data, curl_lock_access, void*);
    8585    static void unlockCallback(CURL*, curl_lock_data, void*);
    86     static Lock* mutexFor(curl_lock_data);
     86    static StaticLock* mutexFor(curl_lock_data);
    8787
    8888    CURLSH* m_shareHandle { nullptr };
  • trunk/Source/WebKitLegacy/ios/ChangeLog

    r224734 r225662  
     12017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        Use StaticLock instead of NeverDestroyed<Lock>
     4        https://bugs.webkit.org/show_bug.cgi?id=180507
     5
     6        Reviewed by Saam Barati.
     7
     8        * WebCoreSupport/WebFixedPositionContent.mm:
     9        (-[WebFixedPositionContent scrollOrZoomChanged:]):
     10        (-[WebFixedPositionContent overflowScrollPositionForLayer:changedTo:]):
     11        (-[WebFixedPositionContent setViewportConstrainedLayers:stickyContainerMap:]):
     12        (-[WebFixedPositionContent hasFixedOrStickyPositionLayers]):
     13        (WebFixedPositionContentDataLock): Deleted.
     14
    1152017-11-11  Megan Gardner  <megan_gardner@apple.com>
    216
  • trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm

    r220506 r225662  
    5050using namespace std;
    5151
    52 static Lock& WebFixedPositionContentDataLock()
    53 {
    54     static NeverDestroyed<Lock> mutex;
    55     return mutex;
    56 }
     52static StaticLock webFixedPositionContentDataLock;
    5753
    5854struct ViewportConstrainedLayerData {
     
    105101- (void)scrollOrZoomChanged:(CGRect)positionedObjectsRect
    106102{
    107     LockHolder lock(WebFixedPositionContentDataLock());
     103    auto locker = holdLock(webFixedPositionContentDataLock);
    108104
    109105    LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
     
    144140- (void)overflowScrollPositionForLayer:(CALayer *)scrollLayer changedTo:(CGPoint)scrollPosition
    145141{
    146     LockHolder lock(WebFixedPositionContentDataLock());
     142    auto locker = holdLock(webFixedPositionContentDataLock);
    147143
    148144    LayerInfoMap::const_iterator end = _private->m_viewportConstrainedLayers.end();
     
    177173- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, std::unique_ptr<WebCore::ViewportConstraints>>&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers
    178174{
    179     LockHolder lock(WebFixedPositionContentDataLock());
     175    auto locker = holdLock(webFixedPositionContentDataLock);
    180176
    181177    _private->m_viewportConstrainedLayers.clear();
     
    194190- (BOOL)hasFixedOrStickyPositionLayers
    195191{
    196     LockHolder lock(WebFixedPositionContentDataLock());
     192    auto locker = holdLock(webFixedPositionContentDataLock);
    197193    return !_private->m_viewportConstrainedLayers.isEmpty();
    198194}
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r225535 r225662  
     12017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        Use StaticLock instead of NeverDestroyed<Lock>
     4        https://bugs.webkit.org/show_bug.cgi?id=180507
     5
     6        Reviewed by Saam Barati.
     7
     8        * WebLocalizableStrings.cpp:
     9        (findCachedString):
     10        (cacheString):
     11        (mainBundleLocStrings): Deleted.
     12        (frameworkLocStringsMutex): Deleted.
     13
    1142017-12-05  Per Arne Vollan  <pvollan@apple.com>
    215
  • trunk/Source/WebKitLegacy/win/WebLocalizableStrings.cpp

    r219858 r225662  
    4646typedef HashMap<String, LocalizedString*> LocalizedStringMap;
    4747
    48 static Lock& mainBundleLocStringsMutex()
    49 {
    50     static NeverDestroyed<Lock> mutex;
    51     return mutex;
    52 }
     48static StaticLock mainBundleLocStringsLock;
    5349
    5450static LocalizedStringMap& mainBundleLocStrings()
     
    5854}
    5955
    60 static Lock& frameworkLocStringsMutex()
    61 {
    62     static NeverDestroyed<Lock> mutex;
    63     return mutex;
    64 }
     56static StaticLock frameworkLocStringsLock;
    6557
    6658static LocalizedStringMap frameworkLocStrings()
     
    177169{
    178170    if (!stringsBundle) {
    179         LockHolder lock(mainBundleLocStringsMutex());
     171        auto locker = holdLock(mainBundleLocStringsLock);
    180172        return mainBundleLocStrings().get(key);
    181173    }
    182174
    183175    if (stringsBundle->bundle == WebKitLocalizableStringsBundle.bundle) {
    184         LockHolder lock(frameworkLocStringsMutex());
     176        auto locker = holdLock(frameworkLocStringsLock);
    185177        return frameworkLocStrings().get(key);
    186178    }
     
    192184{
    193185    if (!stringsBundle) {
    194         LockHolder lock(mainBundleLocStringsMutex());
     186        auto locker = holdLock(mainBundleLocStringsLock);
    195187        mainBundleLocStrings().set(key, value);
    196188        return;
    197189    }
    198190
    199     LockHolder lock(frameworkLocStringsMutex());
     191    auto locker = holdLock(frameworkLocStringsLock);
    200192    frameworkLocStrings().set(key, value);
    201193}
  • trunk/Tools/ChangeLog

    r225645 r225662  
     12017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        Use StaticLock instead of NeverDestroyed<Lock>
     4        https://bugs.webkit.org/show_bug.cgi?id=180507
     5
     6        Reviewed by Saam Barati.
     7
     8        * DumpRenderTree/JavaScriptThreading.cpp:
     9        (javaScriptThreads):
     10        (runJavaScriptThread):
     11        (startJavaScriptThreads):
     12        (stopJavaScriptThreads):
     13        (javaScriptThreadsMutex): Deleted.
     14
    1152017-12-07  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Tools/DumpRenderTree/JavaScriptThreading.cpp

    r223238 r225662  
    4646static bool javaScriptThreadsShouldTerminate;
    4747static JSContextGroupRef javaScriptThreadsGroup;
    48 
    49 static Lock& javaScriptThreadsMutex()
    50 {
    51     static NeverDestroyed<Lock> staticMutex;
    52     return staticMutex;
    53 }
     48static StaticLock javaScriptThreadsLock;
    5449
    5550typedef HashSet<RefPtr<Thread>> ThreadSet;
     
    5752{
    5853    static NeverDestroyed<ThreadSet> staticJavaScriptThreads;
    59     ASSERT(!javaScriptThreadsMutex().tryLock());
     54    ASSERT(!javaScriptThreadsLock.tryLock());
    6055    return staticJavaScriptThreads;
    6156}
     
    7368    JSGlobalContextRef ctx;
    7469    {
    75         LockHolder locker(javaScriptThreadsMutex());
     70        auto locker = holdLock(javaScriptThreadsLock);
    7671        ctx = JSGlobalContextCreateInGroup(javaScriptThreadsGroup, 0);
    7772    }
     
    7974    JSStringRef scriptRef;
    8075    {
    81         LockHolder locker(javaScriptThreadsMutex());
     76        auto locker = holdLock(javaScriptThreadsLock);
    8277        scriptRef = JSStringCreateWithUTF8CString(script);
    8378    }
     
    8580    while (true) {
    8681        {
    87             LockHolder locker(javaScriptThreadsMutex());
     82            auto locker = holdLock(javaScriptThreadsLock);
    8883            JSValueRef exception = 0;
    8984            JSEvaluateScript(ctx, scriptRef, 0, 0, 1, &exception);
     
    9287
    9388        {
    94             LockHolder locker(javaScriptThreadsMutex());
     89            auto locker = holdLock(javaScriptThreadsLock);
    9590            const size_t valuesCount = 1024;
    9691            JSValueRef values[valuesCount];
     
    10095
    10196        {
    102             LockHolder locker(javaScriptThreadsMutex());
     97            auto locker = holdLock(javaScriptThreadsLock);
    10398            if (javaScriptThreadsShouldTerminate)
    10499                break;
     
    109104            continue;
    110105
    111         LockHolder locker(javaScriptThreadsMutex());
     106        auto locker = holdLock(javaScriptThreadsLock);
    112107        Thread& thread = Thread::current();
    113108        thread.detach();
     
    117112    }
    118113
    119     LockHolder locker(javaScriptThreadsMutex());
     114    auto locker = holdLock(javaScriptThreadsLock);
    120115    JSStringRelease(scriptRef);
    121116    JSGarbageCollect(ctx);
     
    127122    javaScriptThreadsGroup = JSContextGroupCreate();
    128123
    129     LockHolder locker(javaScriptThreadsMutex());
     124    auto locker = holdLock(javaScriptThreadsLock);
    130125
    131126    for (size_t i = 0; i < javaScriptThreadsCount; ++i)
     
    136131{
    137132    {
    138         LockHolder locker(javaScriptThreadsMutex());
     133        auto locker = holdLock(javaScriptThreadsLock);
    139134        javaScriptThreadsShouldTerminate = true;
    140135    }
     
    142137    Vector<RefPtr<Thread>, javaScriptThreadsCount> threads;
    143138    {
    144         LockHolder locker(javaScriptThreadsMutex());
     139        auto locker = holdLock(javaScriptThreadsLock);
    145140        threads = copyToVector(javaScriptThreads());
    146141        ASSERT(threads.size() == javaScriptThreadsCount);
     
    151146
    152147    {
    153         LockHolder locker(javaScriptThreadsMutex());
     148        auto locker = holdLock(javaScriptThreadsLock);
    154149        javaScriptThreads().clear();
    155150    }
Note: See TracChangeset for help on using the changeset viewer.