Changeset 195537 in webkit
- Timestamp:
- Jan 25, 2016 9:13:40 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r195535 r195537 1 2016-01-25 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773 4 https://bugs.webkit.org/show_bug.cgi?id=153194 5 6 Reviewed by Michael Catanzaro. 7 8 In r192773 we implemented the JavaScriptCore garbage collector 9 timers for the GTK+ port. Those timers schedule sources in the 10 current thread default main context, but JS web worker threads 11 implementation doesn't use WTF::RunLoop, but its own WorkerRunLoop 12 class that doesn't create a GMainContext for the new thread. This 13 means that for web sites using workers, we are now doing garbage 14 collection of worker VMs in the main thread which ends up in a 15 deadlock at some point. We need to ensure that worker threads 16 create a GMainContext and push it as the default one for the 17 thread before the WorkerGlobalScope is created. This way when the 18 worker Heap is created, the GC timers use the right context to 19 schedule their sources. And then we need to check if there are 20 sources pending in the thread main context on every worker run 21 loop iteration. 22 23 * workers/WorkerRunLoop.cpp: 24 (WebCore::WorkerRunLoop::runInMode): 25 * workers/WorkerThread.cpp: 26 (WebCore::WorkerThread::workerThread): 27 1 28 2016-01-25 Commit Queue <commit-queue@webkit.org> 2 29 -
trunk/Source/WebCore/workers/WorkerRunLoop.cpp
r194496 r195537 40 40 #include <wtf/CurrentTime.h> 41 41 42 #if PLATFORM(GTK) 43 #include <glib.h> 44 #endif 45 42 46 namespace WebCore { 43 47 … … 143 147 ASSERT(context->thread().threadID() == currentThread()); 144 148 149 #if PLATFORM(GTK) 150 GMainContext* mainContext = g_main_context_get_thread_default(); 151 if (g_main_context_pending(mainContext)) 152 g_main_context_iteration(mainContext, FALSE); 153 #endif 154 145 155 double deadline = MessageQueue<Task>::infiniteTime(); 146 156 -
trunk/Source/WebCore/workers/WorkerThread.cpp
r193426 r195537 45 45 #endif 46 46 47 #if PLATFORM(GTK) 48 #include <wtf/glib/GRefPtr.h> 49 #endif 50 47 51 namespace WebCore { 48 52 … … 135 139 #endif 136 140 141 #if PLATFORM(GTK) 142 GRefPtr<GMainContext> mainContext = adoptGRef(g_main_context_new()); 143 g_main_context_push_thread_default(mainContext.get()); 144 #endif 145 137 146 { 138 147 LockHolder lock(m_threadCreationMutex); … … 154 163 155 164 runEventLoop(); 165 166 #if PLATFORM(GTK) 167 g_main_context_pop_thread_default(mainContext.get()); 168 #endif 156 169 157 170 ThreadIdentifier threadID = m_threadID;
Note: See TracChangeset
for help on using the changeset viewer.