diff options
author | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-19 08:44:48 +0000 |
---|---|---|
committer | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-19 08:44:48 +0000 |
commit | 1b3b506816c9992868d2b5c3167dbbcabb3c5f99 (patch) | |
tree | 79986c86d5fbca9c30b95e558a98630d985b2f66 /base | |
parent | 7ec35d3db446919424a9d0a0237edae70009ead9 (diff) | |
download | chromium_src-1b3b506816c9992868d2b5c3167dbbcabb3c5f99.zip chromium_src-1b3b506816c9992868d2b5c3167dbbcabb3c5f99.tar.gz chromium_src-1b3b506816c9992868d2b5c3167dbbcabb3c5f99.tar.bz2 |
Annotate a benign data race in Thread::StopSoon
BUG=23245
TEST=TSan bots
Review URL: http://codereview.chromium.org/2136013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/thread.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/base/thread.cc b/base/thread.cc index e3c335a..97f9599 100644 --- a/base/thread.cc +++ b/base/thread.cc @@ -120,7 +120,10 @@ void Thread::Stop() { void Thread::StopSoon() { // We should only be called on the same thread that started us. - DCHECK_NE(thread_id_, PlatformThread::CurrentId()); + + // Reading thread_id_ without a lock can lead to a benign data race + // with ThreadMain, so we annotate it to stay silent under ThreadSanitizer. + DCHECK_NE(ANNOTATE_UNPROTECTED_READ(thread_id_), PlatformThread::CurrentId()); if (stopping_ || !message_loop_) return; |