Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: base/threading/thread.cc

Issue 11438022: Add ability to retrieve a thread_name given a thread_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the try servers happier. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/threading/platform_thread_win.cc ('k') | base/threading/thread_id_name_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/thread.h" 5 #include "base/threading/thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 9 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
10 #include "base/threading/thread_id_name_manager.h"
10 #include "base/threading/thread_local.h" 11 #include "base/threading/thread_local.h"
11 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
12 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
13 14
14 #if defined(OS_WIN) 15 #if defined(OS_WIN)
15 #include "base/win/scoped_com_initializer.h" 16 #include "base/win/scoped_com_initializer.h"
16 #endif 17 #endif
17 18
18 namespace base { 19 namespace base {
19 20
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 running_(false), 59 running_(false),
59 startup_data_(NULL), 60 startup_data_(NULL),
60 thread_(0), 61 thread_(0),
61 message_loop_(NULL), 62 message_loop_(NULL),
62 thread_id_(kInvalidThreadId), 63 thread_id_(kInvalidThreadId),
63 name_(name) { 64 name_(name) {
64 } 65 }
65 66
66 Thread::~Thread() { 67 Thread::~Thread() {
67 Stop(); 68 Stop();
69 ThreadIdNameManager::GetInstance()->RemoveName(thread_id_);
68 } 70 }
69 71
70 bool Thread::Start() { 72 bool Thread::Start() {
71 Options options; 73 Options options;
72 #if defined(OS_WIN) 74 #if defined(OS_WIN)
73 if (com_status_ == STA) 75 if (com_status_ == STA)
74 options.message_loop_type = MessageLoop::TYPE_UI; 76 options.message_loop_type = MessageLoop::TYPE_UI;
75 #endif 77 #endif
76 return StartWithOptions(options); 78 return StartWithOptions(options);
77 } 79 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 206
205 // Assert that MessageLoop::Quit was called by ThreadQuitHelper. 207 // Assert that MessageLoop::Quit was called by ThreadQuitHelper.
206 DCHECK(GetThreadWasQuitProperly()); 208 DCHECK(GetThreadWasQuitProperly());
207 209
208 // We can't receive messages anymore. 210 // We can't receive messages anymore.
209 message_loop_ = NULL; 211 message_loop_ = NULL;
210 } 212 }
211 } 213 }
212 214
213 } // namespace base 215 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/platform_thread_win.cc ('k') | base/threading/thread_id_name_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698