Replace some usage of EventWrapper with rtc::Event.
Bug: webrtc:3380
Change-Id: Id33b19bf107273e6f838aa633784db73d02ae2c2
Reviewed-on: https://webrtc-review.googlesource.com/c/107888
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25407}
diff --git a/modules/utility/source/process_thread_impl.cc b/modules/utility/source/process_thread_impl.cc
index 9756250..73338ac 100644
--- a/modules/utility/source/process_thread_impl.cc
+++ b/modules/utility/source/process_thread_impl.cc
@@ -44,7 +44,7 @@
}
ProcessThreadImpl::ProcessThreadImpl(const char* thread_name)
- : wake_up_(EventWrapper::Create()),
+ : wake_up_(/*manual_reset=*/false, /*initially_signaled=*/false),
stop_(false),
thread_name_(thread_name) {}
@@ -85,7 +85,7 @@
stop_ = true;
}
- wake_up_->Set();
+ wake_up_.Set();
thread_->Stop();
stop_ = false;
@@ -104,7 +104,7 @@
m.next_callback = kCallProcessImmediately;
}
}
- wake_up_->Set();
+ wake_up_.Set();
}
void ProcessThreadImpl::PostTask(std::unique_ptr<rtc::QueuedTask> task) {
@@ -113,7 +113,7 @@
rtc::CritScope lock(&lock_);
queue_.push(task.release());
}
- wake_up_->Set();
+ wake_up_.Set();
}
void ProcessThreadImpl::RegisterModule(Module* module,
@@ -147,7 +147,7 @@
// Wake the thread calling ProcessThreadImpl::Process() to update the
// waiting time. The waiting time for the just registered module may be
// shorter than all other registered modules.
- wake_up_->Set();
+ wake_up_.Set();
}
void ProcessThreadImpl::DeRegisterModule(Module* module) {
@@ -217,7 +217,7 @@
int64_t time_to_wait = next_checkpoint - rtc::TimeMillis();
if (time_to_wait > 0)
- wake_up_->Wait(static_cast<unsigned long>(time_to_wait));
+ wake_up_.Wait(static_cast<int>(time_to_wait));
return true;
}