diff options
author | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-23 19:17:33 +0000 |
---|---|---|
committer | timurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-23 19:17:33 +0000 |
commit | 94d0d3e75682708fd3b977542f363f9254f9a922 (patch) | |
tree | 7ca85550303da851422889848c28d07bd37b57ea /base/thread.cc | |
parent | 3143a59a5484675fedc1ca7f43e0180ea77efb0a (diff) | |
download | chromium_src-94d0d3e75682708fd3b977542f363f9254f9a922.zip chromium_src-94d0d3e75682708fd3b977542f363f9254f9a922.tar.gz chromium_src-94d0d3e75682708fd3b977542f363f9254f9a922.tar.bz2 |
Notify race detectors (e.g. ThreadSanitizer) about the thread names
ThreadSanitizer will print the name of the threads in data race reports.
ANNOTATE_THREAD_NAME is a no-op in Release non-valgrind build
Review URL: http://codereview.chromium.org/434009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/thread.cc')
-rw-r--r-- | base/thread.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/base/thread.cc b/base/thread.cc index 09f20a7..aeaa0a1 100644 --- a/base/thread.cc +++ b/base/thread.cc @@ -4,6 +4,7 @@ #include "base/thread.h" +#include "base/dynamic_annotations.h" #include "base/lazy_instance.h" #include "base/string_util.h" #include "base/thread_local.h" @@ -139,6 +140,7 @@ void Thread::ThreadMain() { // Complete the initialization of our Thread object. thread_id_ = PlatformThread::CurrentId(); PlatformThread::SetName(name_.c_str()); + ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector. message_loop.set_thread_name(name_); message_loop_ = &message_loop; |