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

Unified Diff: webrtc/system_wrappers/source/event_timer_posix.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month 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
Index: webrtc/system_wrappers/source/event_timer_posix.cc
diff --git a/webrtc/system_wrappers/source/event_timer_posix.cc b/webrtc/system_wrappers/source/event_timer_posix.cc
index ff26e76ec0b3e036bb1cf2c7e5954277b79b5c85..9f9a324bcbc9cba274aad0fe4ac060b87c41a67f 100644
--- a/webrtc/system_wrappers/source/event_timer_posix.cc
+++ b/webrtc/system_wrappers/source/event_timer_posix.cc
@@ -154,14 +154,14 @@ bool EventTimerPosix::StartTimer(bool periodic, unsigned long time) {
// Start the timer thread
timer_event_.reset(new EventTimerPosix());
const char* thread_name = "WebRtc_event_timer_thread";
- timer_thread_ = PlatformThread::CreateThread(Run, this, thread_name);
+ timer_thread_.reset(new rtc::PlatformThread(Run, this, thread_name));
periodic_ = periodic;
time_ = time;
- bool started = timer_thread_->Start();
- timer_thread_->SetPriority(kRealtimePriority);
+ timer_thread_->Start();
+ timer_thread_->SetPriority(rtc::kRealtimePriority);
pthread_mutex_unlock(&mutex_);
- return started;
+ return true;
}
bool EventTimerPosix::Run(void* obj) {
@@ -215,9 +215,7 @@ bool EventTimerPosix::StopTimer() {
timer_event_->Set();
}
if (timer_thread_) {
- if (!timer_thread_->Stop()) {
- return false;
- }
+ timer_thread_->Stop();
timer_thread_.reset();
}
timer_event_.reset();
« no previous file with comments | « webrtc/system_wrappers/source/event_timer_posix.h ('k') | webrtc/test/channel_transport/udp_socket2_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698