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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/threading/thread_id_name_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread.cc
diff --git a/base/threading/thread.cc b/base/threading/thread.cc
index 35e88a70569a2b6dfcae8122bab5290d57ed140a..123c9778bfd156d0d46fc62332307e244e23fc11 100644
--- a/base/threading/thread.cc
+++ b/base/threading/thread.cc
@@ -66,7 +66,6 @@ Thread::Thread(const char* name)
Thread::~Thread() {
Stop();
- ThreadIdNameManager::GetInstance()->RemoveName(thread_id_);
}
bool Thread::Start() {
@@ -121,6 +120,8 @@ void Thread::Stop() {
//
PlatformThread::Join(thread_);
+ ThreadIdNameManager::GetInstance()->RemoveName(thread_id_);
jar (doing other things) 2013/05/14 16:49:10 Given the problem you had... this solution is stil
dsinclair 2013/05/14 17:00:17 You're right, there is still a race here. Looking
jar (doing other things) 2013/05/14 19:55:06 I don't fully grok the use case... but I suspect y
+
// The thread should NULL message_loop_ on exit.
DCHECK(!message_loop_);
« no previous file with comments | « no previous file | base/threading/thread_id_name_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698