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

Side by Side Diff: webrtc/base/signalthread.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years 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 | « webrtc/base/signalthread.h ('k') | webrtc/base/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 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 21 matching lines...) Expand all
32 ASSERT(refcount_ == 0); 32 ASSERT(refcount_ == 0);
33 } 33 }
34 34
35 bool SignalThread::SetName(const std::string& name, const void* obj) { 35 bool SignalThread::SetName(const std::string& name, const void* obj) {
36 EnterExit ee(this); 36 EnterExit ee(this);
37 ASSERT(main_->IsCurrent()); 37 ASSERT(main_->IsCurrent());
38 ASSERT(kInit == state_); 38 ASSERT(kInit == state_);
39 return worker_.SetName(name, obj); 39 return worker_.SetName(name, obj);
40 } 40 }
41 41
42 bool SignalThread::SetPriority(ThreadPriority priority) {
43 EnterExit ee(this);
44 ASSERT(main_->IsCurrent());
45 ASSERT(kInit == state_);
46 return worker_.SetPriority(priority);
47 }
48
49 void SignalThread::Start() { 42 void SignalThread::Start() {
50 EnterExit ee(this); 43 EnterExit ee(this);
51 ASSERT(main_->IsCurrent()); 44 ASSERT(main_->IsCurrent());
52 if (kInit == state_ || kComplete == state_) { 45 if (kInit == state_ || kComplete == state_) {
53 state_ = kRunning; 46 state_ = kRunning;
54 OnWorkStart(); 47 OnWorkStart();
55 worker_.Start(); 48 worker_.Start();
56 } else { 49 } else {
57 ASSERT(false); 50 ASSERT(false);
58 } 51 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 141 }
149 } 142 }
150 } 143 }
151 144
152 void SignalThread::OnMainThreadDestroyed() { 145 void SignalThread::OnMainThreadDestroyed() {
153 EnterExit ee(this); 146 EnterExit ee(this);
154 main_ = NULL; 147 main_ = NULL;
155 } 148 }
156 149
157 } // namespace rtc 150 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/signalthread.h ('k') | webrtc/base/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698