#include "perfetto/base/build_config.h"
#include "perfetto/ext/base/thread_task_runner.h"
#include <condition_variable>
#include <functional>
#include <mutex>
#include <thread>
#include "perfetto/base/logging.h"
#include "perfetto/ext/base/thread_utils.h"
#include "perfetto/ext/base/unix_task_runner.h"
#if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
#include <sys/prctl.h>
#endif
namespace perfetto {
namespace base {
ThreadTaskRunner::ThreadTaskRunner(ThreadTaskRunner&& other) noexcept
: … { … }
ThreadTaskRunner& ThreadTaskRunner::operator=(ThreadTaskRunner&& other) { … }
ThreadTaskRunner::~ThreadTaskRunner() { … }
ThreadTaskRunner::ThreadTaskRunner(const std::string& name) : … { … }
void ThreadTaskRunner::RunTaskThread(
std::function<void(UnixTaskRunner*)> initializer) { … }
void ThreadTaskRunner::PostTaskAndWaitForTesting(std::function<void()> fn) { … }
uint64_t ThreadTaskRunner::GetThreadCPUTimeNsForTesting() { … }
void ThreadTaskRunner::PostTask(std::function<void()> task) { … }
void ThreadTaskRunner::PostDelayedTask(std::function<void()> task,
uint32_t delay_ms) { … }
void ThreadTaskRunner::AddFileDescriptorWatch(
PlatformHandle handle,
std::function<void()> watch_task) { … }
void ThreadTaskRunner::RemoveFileDescriptorWatch(PlatformHandle handle) { … }
bool ThreadTaskRunner::RunsTasksOnCurrentThread() const { … }
}
}