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

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

Issue 14634009: Move Thread Name Mapping into ThreadFunc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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_id_name_manager.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 running_(false), 59 running_(false),
60 startup_data_(NULL), 60 startup_data_(NULL),
61 thread_(0), 61 thread_(0),
62 message_loop_(NULL), 62 message_loop_(NULL),
63 thread_id_(kInvalidThreadId), 63 thread_id_(kInvalidThreadId),
64 name_(name) { 64 name_(name) {
65 } 65 }
66 66
67 Thread::~Thread() { 67 Thread::~Thread() {
68 Stop(); 68 Stop();
69 ThreadIdNameManager::GetInstance()->RemoveName(thread_id_);
70 } 69 }
71 70
72 bool Thread::Start() { 71 bool Thread::Start() {
73 Options options; 72 Options options;
74 #if defined(OS_WIN) 73 #if defined(OS_WIN)
75 if (com_status_ == STA) 74 if (com_status_ == STA)
76 options.message_loop_type = MessageLoop::TYPE_UI; 75 options.message_loop_type = MessageLoop::TYPE_UI;
77 #endif 76 #endif
78 return StartWithOptions(options); 77 return StartWithOptions(options);
79 } 78 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 212
214 // Assert that MessageLoop::Quit was called by ThreadQuitHelper. 213 // Assert that MessageLoop::Quit was called by ThreadQuitHelper.
215 DCHECK(GetThreadWasQuitProperly()); 214 DCHECK(GetThreadWasQuitProperly());
216 215
217 // We can't receive messages anymore. 216 // We can't receive messages anymore.
218 message_loop_ = NULL; 217 message_loop_ = NULL;
219 } 218 }
220 } 219 }
221 220
222 } // namespace base 221 } // 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