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

Unified Diff: base/threading/thread.cc

Issue 10399097: Base: Don't overwrite the thread id when ThreadMain exits. There's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « base/threading/thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread.cc
===================================================================
--- base/threading/thread.cc (revision 138018)
+++ base/threading/thread.cc (working copy)
@@ -47,6 +47,7 @@
Thread::Thread(const char* name)
: started_(false),
stopping_(false),
+ running_(false),
startup_data_(NULL),
thread_(0),
message_loop_(NULL),
@@ -124,6 +125,10 @@
message_loop_->PostTask(FROM_HERE, base::Bind(&ThreadQuitHelper));
}
+bool Thread::IsRunning() const {
+ return running_;
+}
+
void Thread::Run(MessageLoop* message_loop) {
message_loop->Run();
}
@@ -160,7 +165,9 @@
// startup_data_ can't be touched anymore since the starting thread is now
// unlocked.
+ running_ = true;
Run(message_loop_);
+ running_ = false;
// Let the thread do extra cleanup.
CleanUp();
@@ -171,7 +178,6 @@
// We can't receive messages anymore.
message_loop_ = NULL;
}
- thread_id_ = kInvalidThreadId;
}
} // namespace base
« no previous file with comments | « base/threading/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698