Replace Thread::Invoke with Thread::BlockingCall
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed
Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
diff --git a/rtc_tools/network_tester/test_controller.cc b/rtc_tools/network_tester/test_controller.cc
index 4ba43cc..6fe83fd 100644
--- a/rtc_tools/network_tester/test_controller.cc
+++ b/rtc_tools/network_tester/test_controller.cc
@@ -38,7 +38,7 @@
send_data_.fill(42);
packet_sender_thread_->SetName("PacketSender", nullptr);
packet_sender_thread_->Start();
- packet_sender_thread_->Invoke<void>(RTC_FROM_HERE, [&] {
+ packet_sender_thread_->BlockingCall([&] {
RTC_DCHECK_RUN_ON(packet_sender_thread_.get());
udp_socket_ =
std::unique_ptr<rtc::AsyncPacketSocket>(socket_factory_.CreateUdpSocket(
@@ -49,8 +49,8 @@
TestController::~TestController() {
RTC_DCHECK_RUN_ON(&test_controller_thread_checker_);
- packet_sender_thread_->Invoke<void>(
- RTC_FROM_HERE, [this]() { task_safety_flag_->SetNotAlive(); });
+ packet_sender_thread_->BlockingCall(
+ [this]() { task_safety_flag_->SetNotAlive(); });
}
void TestController::SendConnectTo(const std::string& hostname, int port) {