Ignore:
Timestamp:
Apr 24, 2017, 2:11:44 PM (8 years ago)
Author:
[email protected]
Message:

ASSERTION FAILED: m_table seen with workers/wasm-hashset LayoutTests
https://bugs.webkit.org/show_bug.cgi?id=171119
<rdar://problem/31760635>

Reviewed by Keith Miller.

The HashSet of timer set notification callbacks can be accessed
and augmented simultaneously from different threads. e.g, the worker
thread can augment it while the wasm compilation thread will
access it. Therefore, accesses must be guarded by a lock.

  • runtime/JSRunLoopTimer.cpp:

(JSC::JSRunLoopTimer::scheduleTimer):
(JSC::JSRunLoopTimer::addTimerSetNotification):
(JSC::JSRunLoopTimer::removeTimerSetNotification):

  • runtime/JSRunLoopTimer.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp

    r215353 r215694  
    105105    CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + intervalInSeconds.seconds());
    106106    m_isScheduled = true;
     107    auto locker = holdLock(m_timerCallbacksLock);
    107108    for (auto& task : m_timerSetCallbacks)
    108109        task->run();
     
    143144    m_timer.startOneShot(intervalInSeconds);
    144145    m_isScheduled = true;
     146
     147    auto locker = holdLock(m_timerCallbacksLock);
    145148    for (auto& task : m_timerSetCallbacks)
    146149        task->run();
     
    157160void JSRunLoopTimer::addTimerSetNotification(TimerNotificationCallback callback)
    158161{
     162    auto locker = holdLock(m_timerCallbacksLock);
    159163    m_timerSetCallbacks.add(callback);
    160164}
     
    162166void JSRunLoopTimer::removeTimerSetNotification(TimerNotificationCallback callback)
    163167{
     168    auto locker = holdLock(m_timerCallbacksLock);
    164169    m_timerSetCallbacks.remove(callback);
    165170}
Note: See TracChangeset for help on using the changeset viewer.