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

Unified Diff: base/threading/thread.cc

Issue 6085015: Order function definitions in base/ according to the header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lrn2merge Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/threading/simple_thread.cc ('k') | base/time.h » ('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 09f88471f884e04a568e3f469c95396100f7fdc4..c0fb53739de51e43324cff8a8555f19752f90098 100644
--- a/base/threading/thread.cc
+++ b/base/threading/thread.cc
@@ -11,6 +11,17 @@
namespace base {
+namespace {
+
+// We use this thread-local variable to record whether or not a thread exited
+// because its Stop method was called. This allows us to catch cases where
+// MessageLoop::Quit() is called directly, which is unexpected when using a
+// Thread to setup and run a MessageLoop.
+base::LazyInstance<base::ThreadLocalBoolean> lazy_tls_bool(
+ base::LINKER_INITIALIZED);
+
+} // namespace
+
// This task is used to trigger the message loop to exit.
class ThreadQuitTask : public Task {
public:
@@ -48,29 +59,6 @@ Thread::~Thread() {
Stop();
}
-namespace {
-
-// We use this thread-local variable to record whether or not a thread exited
-// because its Stop method was called. This allows us to catch cases where
-// MessageLoop::Quit() is called directly, which is unexpected when using a
-// Thread to setup and run a MessageLoop.
-base::LazyInstance<base::ThreadLocalBoolean> lazy_tls_bool(
- base::LINKER_INITIALIZED);
-
-} // namespace
-
-void Thread::SetThreadWasQuitProperly(bool flag) {
- lazy_tls_bool.Pointer()->Set(flag);
-}
-
-bool Thread::GetThreadWasQuitProperly() {
- bool quit_properly = true;
-#ifndef NDEBUG
- quit_properly = lazy_tls_bool.Pointer()->Get();
-#endif
- return quit_properly;
-}
-
bool Thread::Start() {
return StartWithOptions(Options());
}
@@ -140,6 +128,18 @@ void Thread::Run(MessageLoop* message_loop) {
message_loop->Run();
}
+void Thread::SetThreadWasQuitProperly(bool flag) {
+ lazy_tls_bool.Pointer()->Set(flag);
+}
+
+bool Thread::GetThreadWasQuitProperly() {
+ bool quit_properly = true;
+#ifndef NDEBUG
+ quit_properly = lazy_tls_bool.Pointer()->Get();
+#endif
+ return quit_properly;
+}
+
void Thread::ThreadMain() {
{
// The message loop for this thread.
« no previous file with comments | « base/threading/simple_thread.cc ('k') | base/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698