
This reverts commit 42d8c93ec351b68554825b58a3dc6525a7dc84da. Reason for revert: Got Aliby for FEC test flakes Original change's description: > Revert "Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current" > > This reverts commit 304e9d2df347630d71fd4423f5971f30dac73e41. > > Reason for revert: Breaks downstream projects. > Seems to make VideoSendStreamTest.SupportsFlexfecSimulcastVp8 flaky. > > Original change's description: > > Delete rtc::TaskQueue::Current in favor of webrtc::TaskQueueBase::Current > > > > Bug: webrtc:10191 > > Change-Id: I506cc50a90c73a6a4f6a3de36de0999cca72f5ba > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126230 > > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> > > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#27035} > > TBR=danilchap@webrtc.org,kwiberg@webrtc.org > > Change-Id: If98324f88e4b3d18bf2fe33597dfb9711867c243 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:10191 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126484 > Reviewed-by: Yves Gerey <yvesg@webrtc.org> > Commit-Queue: Yves Gerey <yvesg@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#27041} TBR=danilchap@webrtc.org,kwiberg@webrtc.org,yvesg@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:10191 Change-Id: Id87a17ae415142b8e0b11ba03ae7bad84a473fb0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126720 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Yves Gerey <yvesg@webrtc.org> Commit-Queue: Yves Gerey <yvesg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27056}
47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
/*
|
|
* Copyright 2019 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#include "rtc_base/task_queue.h"
|
|
|
|
#include "api/task_queue/global_task_queue_factory.h"
|
|
#include "api/task_queue/task_queue_base.h"
|
|
|
|
namespace rtc {
|
|
|
|
TaskQueue::TaskQueue(
|
|
std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter> task_queue)
|
|
: impl_(task_queue.release()) {}
|
|
|
|
TaskQueue::TaskQueue(const char* queue_name, Priority priority)
|
|
: TaskQueue(webrtc::GlobalTaskQueueFactory().CreateTaskQueue(queue_name,
|
|
priority)) {}
|
|
|
|
TaskQueue::~TaskQueue() {
|
|
// There might running task that tries to rescheduler itself to the TaskQueue
|
|
// and not yet aware TaskQueue destructor is called.
|
|
// Calling back to TaskQueue::PostTask need impl_ pointer still be valid, so
|
|
// do not invalidate impl_ pointer until Delete returns.
|
|
impl_->Delete();
|
|
}
|
|
|
|
bool TaskQueue::IsCurrent() const {
|
|
return impl_->IsCurrent();
|
|
}
|
|
|
|
void TaskQueue::PostTask(std::unique_ptr<QueuedTask> task) {
|
|
return impl_->PostTask(std::move(task));
|
|
}
|
|
|
|
void TaskQueue::PostDelayedTask(std::unique_ptr<QueuedTask> task,
|
|
uint32_t milliseconds) {
|
|
return impl_->PostDelayedTask(std::move(task), milliseconds);
|
|
}
|
|
|
|
} // namespace rtc
|