diff options
author | Danil Chapovalov <danilchap@webrtc.org> | 2019-11-22 15:52:40 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-25 11:38:27 +0000 |
commit | 912b3b83b380fbcf608d5b9ad15c6aed99f3b065 (patch) | |
tree | 67da0c0817657d5b793b08b3e9982001a6a7cc19 /logging | |
parent | 2aaf4afb09513644f1dcff04d10db63f87f1eb62 (diff) | |
download | webrtc-912b3b83b380fbcf608d5b9ad15c6aed99f3b065.tar.gz |
Make rtc::Thread a TaskQueue
in support of converging on single way to run asynchronous tasks in webrtc
Bug: b/144982320
Change-Id: I200ad298136d11764a3f5c0547ebcba51aceafa0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158782
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29896}
Diffstat (limited to 'logging')
-rw-r--r-- | logging/rtc_event_log/rtc_event_log_impl.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index 8735cb4782..e1e1aabec0 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -114,15 +114,11 @@ bool RtcEventLogImpl::StartLogging(std::unique_ptr<RtcEventLogOutput> output, void RtcEventLogImpl::StopLogging() { RTC_LOG(LS_INFO) << "Stopping WebRTC event log."; - + // TODO(danilchap): Do not block current thread waiting on the task queue. + // It might work for now, for current callers, but disallows caller to share + // threads with the |task_queue_|. rtc::Event output_stopped; StopLogging([&output_stopped]() { output_stopped.Set(); }); - - // By making sure StopLogging() is not executed on a task queue, - // we ensure it's not running on a thread that is shared with |task_queue_|, - // meaning the following Wait() will not block forever. - RTC_DCHECK(TaskQueueBase::Current() == nullptr); - output_stopped.Wait(rtc::Event::kForever); RTC_LOG(LS_INFO) << "WebRTC event log successfully stopped."; |