#include "base/task/post_job.h"
#include "base/task/scoped_set_task_priority_for_current_thread.h"
#include "base/task/thread_pool/job_task_source.h"
#include "base/task/thread_pool/pooled_task_runner_delegate.h"
#include "base/task/thread_pool/thread_pool_impl.h"
#include "base/task/thread_pool/thread_pool_instance.h"
namespace base {
namespace {
scoped_refptr<internal::JobTaskSource> CreateJobTaskSource(
const Location& from_here,
const TaskTraits& traits,
RepeatingCallback<void(JobDelegate*)> worker_task,
MaxConcurrencyCallback max_concurrency_callback) { … }
}
JobDelegate::JobDelegate(
internal::JobTaskSource* task_source,
internal::PooledTaskRunnerDelegate* pooled_task_runner_delegate)
: … { … }
JobDelegate::~JobDelegate() { … }
bool JobDelegate::ShouldYield() { … }
void JobDelegate::YieldIfNeeded() { … }
void JobDelegate::NotifyConcurrencyIncrease() { … }
uint8_t JobDelegate::GetTaskId() { … }
JobHandle::JobHandle() = default;
JobHandle::JobHandle(scoped_refptr<internal::JobTaskSource> task_source)
: … { … }
JobHandle::~JobHandle() { … }
JobHandle::JobHandle(JobHandle&&) = default;
JobHandle& JobHandle::operator=(JobHandle&& other) { … }
bool JobHandle::IsActive() const { … }
void JobHandle::UpdatePriority(TaskPriority new_priority) { … }
void JobHandle::NotifyConcurrencyIncrease() { … }
void JobHandle::Join() { … }
void JobHandle::Cancel() { … }
void JobHandle::CancelAndDetach() { … }
void JobHandle::Detach() { … }
JobHandle PostJob(const Location& from_here,
const TaskTraits& traits,
RepeatingCallback<void(JobDelegate*)> worker_task,
MaxConcurrencyCallback max_concurrency_callback) { … }
JobHandle CreateJob(const Location& from_here,
const TaskTraits& traits,
RepeatingCallback<void(JobDelegate*)> worker_task,
MaxConcurrencyCallback max_concurrency_callback) { … }
}