diff options
author | huanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 03:46:53 +0000 |
---|---|---|
committer | huanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 03:46:53 +0000 |
commit | 9dbd128cc63c70c8fa9ee09174c27ae87e355170 (patch) | |
tree | 2e3806ab8d5b107715422a86dc79a157b708156c /base | |
parent | f0e4333614a7be4800970f4c1a975325f387a7f8 (diff) | |
download | chromium_src-9dbd128cc63c70c8fa9ee09174c27ae87e355170.zip chromium_src-9dbd128cc63c70c8fa9ee09174c27ae87e355170.tar.gz chromium_src-9dbd128cc63c70c8fa9ee09174c27ae87e355170.tar.bz2 |
Adding debugging info for thread name.
This may not provide enough information to analyze the bug,
but it is a start with minimal impact.
BUG=54307
TEST=none
Review URL: http://codereview.chromium.org/3337012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/thread.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/base/thread.cc b/base/thread.cc index 41d78f0..f898cd1 100644 --- a/base/thread.cc +++ b/base/thread.cc @@ -136,10 +136,28 @@ void Thread::StopSoon() { message_loop_->PostTask(FROM_HERE, new ThreadQuitTask()); } +#if defined(OS_WIN) +#pragma warning (disable: 4748) +#pragma optimize( "", off ) +#endif + void Thread::Run(MessageLoop* message_loop) { +#if defined(OS_WIN) + // Logging the thread name for debugging. + // TODO(huanr): remove after done. + // http://code.google.com/p/chromium/issues/detail?id=54307 + char name[16]; + strncpy(name, name_.c_str(), arraysize(name) - 1); + name[arraysize(name) - 1] = '\0'; +#endif message_loop->Run(); } +#if defined(OS_WIN) +#pragma optimize( "", on ) +#pragma warning (default: 4748) +#endif + void Thread::ThreadMain() { { // The message loop for this thread. |