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

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

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/threading/sequenced_worker_pool_unittest.cc ('k') | base/threading/thread.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/simple_thread.h" 5 #include "base/threading/simple_thread.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 bool SimpleThread::HasBeenStarted() { 45 bool SimpleThread::HasBeenStarted() {
46 base::ThreadRestrictions::ScopedAllowWait allow_wait; 46 base::ThreadRestrictions::ScopedAllowWait allow_wait;
47 return event_.IsSignaled(); 47 return event_.IsSignaled();
48 } 48 }
49 49
50 void SimpleThread::ThreadMain() { 50 void SimpleThread::ThreadMain() {
51 tid_ = PlatformThread::CurrentId(); 51 tid_ = PlatformThread::CurrentId();
52 // Construct our full name of the form "name_prefix_/TID". 52 // Construct our full name of the form "name_prefix_/TID".
53 name_.push_back('/'); 53 name_.push_back('/');
54 name_.append(IntToString(tid_)); 54 name_.append(IntToString(tid_));
55 PlatformThread::SetName(name_.c_str()); 55 PlatformThread::SetName(name_);
56 56
57 // We've initialized our new thread, signal that we're done to Start(). 57 // We've initialized our new thread, signal that we're done to Start().
58 event_.Signal(); 58 event_.Signal();
59 59
60 Run(); 60 Run();
61 } 61 }
62 62
63 DelegateSimpleThread::DelegateSimpleThread(Delegate* delegate, 63 DelegateSimpleThread::DelegateSimpleThread(Delegate* delegate,
64 const std::string& name_prefix) 64 const std::string& name_prefix)
65 : SimpleThread(name_prefix), 65 : SimpleThread(name_prefix),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 // A NULL delegate pointer signals us to quit. 151 // A NULL delegate pointer signals us to quit.
152 if (!work) 152 if (!work)
153 break; 153 break;
154 154
155 work->Run(); 155 work->Run();
156 } 156 }
157 } 157 }
158 158
159 } // namespace base 159 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/sequenced_worker_pool_unittest.cc ('k') | base/threading/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698