Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Issue 12096050: Merge 140483 (Closed)

Created:
7 years, 10 months ago by jsbell
Modified:
7 years, 10 months ago
Reviewers:
jsbell
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Visibility:
Public.

Description

Merge 140483 > Prevent race condition during Worker shutdown > https://bugs.webkit.org/show_bug.cgi?id=107577 > > Reviewed by Dmitry Titov. > > Source/WebCore: > > During worker shutdown, from the main thread a cleanup task is posted followed by > terminating the message queue, which prevents further tasks from being processed. It was > possible for another task be posted by another thread between the main thread calls > to postTask and terminate(), which would cause that task to run after cleanup. Expose > a new WTF::MessageQueue::appendAndKill() method which keeps a mutex around the two steps, > and use that during worker shutdown. > > No reliable tests for the race - problem identified by inspection of user crash stacks. > > * workers/WorkerRunLoop.cpp: > (WebCore::WorkerRunLoop::postTaskAndTerminate): New method, uses MessageQueue::appendAndKill() > * workers/WorkerRunLoop.h: > * workers/WorkerThread.cpp: > (WebCore::WorkerThread::stop): Uses postTaskAndTerminate() to avoid race. > > Source/WTF: > > Add MessageQueue::appendAndKill() which wraps those two steps with a mutex so other > threads can't sneak a message in between. > > * wtf/MessageQueue.h: Added appendAndKill() method. > TBR=jsbell@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=141169

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -1 line) Patch
M Source/WTF/wtf/MessageQueue.h View 2 chunks +10 lines, -0 lines 0 comments Download
M Source/WebCore/workers/WorkerRunLoop.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/WebCore/workers/WorkerRunLoop.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/WebCore/workers/WorkerThread.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 1 (0 generated)
jsbell
7 years, 10 months ago (2013-01-29 22:58:11 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698