Commit b535b394 authored by joi@chromium.org's avatar joi@chromium.org

Quick fix for memory race inherent to all subclasses of base::Thread.

This is a local fix because TSAN is complaining only about this
particular case.  A follow-up change (which will likely take more
time) will make sure this is OK across the code-base.

BUG=98716,102134


Review URL: http://codereview.chromium.org/8343062

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107755 0039d316-1c4b-4281-b951-d872f2087c98
parent 6c52dc7b
...@@ -43,6 +43,12 @@ BrowserThreadImpl::BrowserThreadImpl(BrowserThread::ID identifier, ...@@ -43,6 +43,12 @@ BrowserThreadImpl::BrowserThreadImpl(BrowserThread::ID identifier,
} }
BrowserThreadImpl::~BrowserThreadImpl() { BrowserThreadImpl::~BrowserThreadImpl() {
// Subclasses of base::Thread() (or at least the most-derived
// subclass) must call Stop() in their destructor, otherwise the
// vtable for the object can change while the thread's message loop
// is still running, and it uses the object's vtable (it calls the
// virtual method Run).
Stop();
} }
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment