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

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

Issue 1613013002: Remove non-monotonic clock support (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cleanup Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/system_wrappers/BUILD.gn » ('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 (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 stop_event_.Set(); 172 stop_event_.Set();
173 RTC_CHECK_EQ(0, pthread_join(thread_, nullptr)); 173 RTC_CHECK_EQ(0, pthread_join(thread_, nullptr));
174 thread_ = 0; 174 thread_ = 0;
175 #endif // defined(WEBRTC_WIN) 175 #endif // defined(WEBRTC_WIN)
176 } 176 }
177 177
178 void PlatformThread::Run() { 178 void PlatformThread::Run() {
179 if (!name_.empty()) 179 if (!name_.empty())
180 rtc::SetCurrentThreadName(name_.c_str()); 180 rtc::SetCurrentThreadName(name_.c_str());
181 do { 181 do {
182 // The interface contract of Start/Stop is that for a successfull call to 182 // The interface contract of Start/Stop is that for a successful call to
183 // Start, there should be at least one call to the run function. So we 183 // Start, there should be at least one call to the run function. So we
184 // call the function before checking |stop_|. 184 // call the function before checking |stop_|.
185 if (!run_function_(obj_)) 185 if (!run_function_(obj_))
186 break; 186 break;
187 #if defined(WEBRTC_WIN) 187 #if defined(WEBRTC_WIN)
188 // Alertable sleep to permit RaiseFlag to run and update |stop_|. 188 // Alertable sleep to permit RaiseFlag to run and update |stop_|.
189 SleepEx(0, true); 189 SleepEx(0, true);
190 } while (!stop_); 190 } while (!stop_);
191 #else 191 #else
192 } while (!stop_event_.Wait(0)); 192 } while (!stop_event_.Wait(0));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 break; 241 break;
242 case kRealtimePriority: 242 case kRealtimePriority:
243 param.sched_priority = top_prio; 243 param.sched_priority = top_prio;
244 break; 244 break;
245 } 245 }
246 return pthread_setschedparam(thread_, policy, &param) == 0; 246 return pthread_setschedparam(thread_, policy, &param) == 0;
247 #endif // defined(WEBRTC_WIN) 247 #endif // defined(WEBRTC_WIN)
248 } 248 }
249 249
250 } // namespace rtc 250 } // namespace rtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/system_wrappers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698