Chromium Code Reviews| Index: base/threading/thread.cc |
| diff --git a/base/threading/thread.cc b/base/threading/thread.cc |
| index aca4ddbaa02a11c37ef02b39b5e4c3da829f404e..01be67fb1c24b07b7d5c058032bf57a7e698ffa5 100644 |
| --- a/base/threading/thread.cc |
| +++ b/base/threading/thread.cc |
| @@ -172,6 +172,18 @@ bool Thread::GetThreadWasQuitProperly() { |
| void Thread::ThreadMain() { |
| { |
| +#if defined(OS_MACOSX) |
| + // Store the thread name on the stack to debug <http://crbug.com/274705>. |
| + // End with a byte sequence of <EOT><BEL><NUL> to make it easier to grep in |
| + // the minidump stack dump. |
|
Mark Mentovai
2013/09/12 18:38:37
If you’re trying to make it easier to find in a mi
Robert Sesek
2013/09/12 18:47:53
If strlen(s2) < n, then it fills the remainder wit
|
| + const size_t kThreadNameSize = 50; |
| + char thread_name[kThreadNameSize]; |
| + strncpy(thread_name, name_.c_str(), kThreadNameSize); |
| + thread_name[kThreadNameSize - 1] = '\0'; |
| + thread_name[kThreadNameSize - 2] = '\7'; |
| + thread_name[kThreadNameSize - 3] = '\3'; |
|
Mark Mentovai
2013/09/12 18:38:37
How are you assuring that storage for variable, un
Robert Sesek
2013/09/12 18:47:53
Good point. Using base::debug::Alias() now at the
|
| +#endif |
| + |
| // The message loop for this thread. |
| // Allocated on the heap to centralize any leak reports at this line. |
| scoped_ptr<MessageLoop> message_loop( |