Changeset 215694 in webkit
- Timestamp:
- Apr 24, 2017 2:11:44 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r215689 r215694 1 2017-04-24 Saam Barati <sbarati@apple.com> 2 3 ASSERTION FAILED: m_table seen with workers/wasm-hashset LayoutTests 4 https://bugs.webkit.org/show_bug.cgi?id=171119 5 <rdar://problem/31760635> 6 7 Reviewed by Keith Miller. 8 9 The HashSet of timer set notification callbacks can be accessed 10 and augmented simultaneously from different threads. e.g, the worker 11 thread can augment it while the wasm compilation thread will 12 access it. Therefore, accesses must be guarded by a lock. 13 14 * runtime/JSRunLoopTimer.cpp: 15 (JSC::JSRunLoopTimer::scheduleTimer): 16 (JSC::JSRunLoopTimer::addTimerSetNotification): 17 (JSC::JSRunLoopTimer::removeTimerSetNotification): 18 * runtime/JSRunLoopTimer.h: 19 1 20 2017-04-24 Joseph Pecoraro <pecoraro@apple.com> 2 21 -
trunk/Source/JavaScriptCore/runtime/JSRunLoopTimer.cpp
r215353 r215694 105 105 CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + intervalInSeconds.seconds()); 106 106 m_isScheduled = true; 107 auto locker = holdLock(m_timerCallbacksLock); 107 108 for (auto& task : m_timerSetCallbacks) 108 109 task->run(); … … 143 144 m_timer.startOneShot(intervalInSeconds); 144 145 m_isScheduled = true; 146 147 auto locker = holdLock(m_timerCallbacksLock); 145 148 for (auto& task : m_timerSetCallbacks) 146 149 task->run(); … … 157 160 void JSRunLoopTimer::addTimerSetNotification(TimerNotificationCallback callback) 158 161 { 162 auto locker = holdLock(m_timerCallbacksLock); 159 163 m_timerSetCallbacks.add(callback); 160 164 } … … 162 166 void JSRunLoopTimer::removeTimerSetNotification(TimerNotificationCallback callback) 163 167 { 168 auto locker = holdLock(m_timerCallbacksLock); 164 169 m_timerSetCallbacks.remove(callback); 165 170 } -
trunk/Source/JavaScriptCore/runtime/JSRunLoopTimer.h
r215353 r215694 63 63 bool isScheduled() const { return m_isScheduled; } 64 64 65 // Note: The only thing the timer notification callback cannot do is 66 // call scheduleTimer(). This will cause a deadlock. It would not 67 // be hard to make this work, however, there are no clients that need 68 // this behavior. We should implement it only if we find that we need it. 65 69 JS_EXPORT_PRIVATE void addTimerSetNotification(TimerNotificationCallback); 66 70 JS_EXPORT_PRIVATE void removeTimerSetNotification(TimerNotificationCallback); … … 88 92 #endif 89 93 94 Lock m_timerCallbacksLock; 90 95 HashSet<TimerNotificationCallback> m_timerSetCallbacks; 91 96
Note: See TracChangeset
for help on using the changeset viewer.