Files
rk35xx-android14/external/libchrome/base/task_scheduler/task_tracker_posix.cc
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

34 lines
1.0 KiB
C++

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/task_scheduler/task_tracker_posix.h"
#include <utility>
#include "base/files/file_descriptor_watcher_posix.h"
namespace base {
namespace internal {
TaskTrackerPosix::TaskTrackerPosix(StringPiece name) : TaskTracker(name) {}
TaskTrackerPosix::~TaskTrackerPosix() = default;
void TaskTrackerPosix::RunOrSkipTask(Task task,
Sequence* sequence,
bool can_run_task) {
DCHECK(watch_file_descriptor_message_loop_);
FileDescriptorWatcher file_descriptor_watcher(
watch_file_descriptor_message_loop_);
TaskTracker::RunOrSkipTask(std::move(task), sequence, can_run_task);
}
#if DCHECK_IS_ON()
bool TaskTrackerPosix::IsPostingBlockShutdownTaskAfterShutdownAllowed() {
return service_thread_handle_.is_equal(PlatformThread::CurrentHandle());
}
#endif
} // namespace internal
} // namespace base