class ThreadTaskRunner
Defined at line 37 of file ../../third_party/perfetto/include/perfetto/ext/base/thread_task_runner.h
A MaybeLockFreeTaskRunner backed by a dedicated task thread. Shuts down the
runner and joins the thread upon destruction. Can be moved to transfer
ownership.
Guarantees that:
* the MaybeLockFreeTaskRunner will be constructed and destructed on the task
thread.
* the task thread will live for the lifetime of the MaybeLockFreeTaskRunner.
Public Methods
ThreadTaskRunner CreateAndStart (const std::string & name)
Defined at line 39 of file ../../third_party/perfetto/include/perfetto/ext/base/thread_task_runner.h
void ThreadTaskRunner (const ThreadTaskRunner & )
Defined at line 43 of file ../../third_party/perfetto/include/perfetto/ext/base/thread_task_runner.h
void ThreadTaskRunner (ThreadTaskRunner && )
ThreadTaskRunner & operator= (const ThreadTaskRunner & )
Defined at line 44 of file ../../third_party/perfetto/include/perfetto/ext/base/thread_task_runner.h
ThreadTaskRunner & operator= (ThreadTaskRunner && )
void ~ThreadTaskRunner ()
void PostTaskAndWaitForTesting (std::function<void ()> )
Executes the given function on the task runner thread and blocks the caller
thread until the function has run.
uint64_t GetThreadCPUTimeNsForTesting ()
Can be called from another thread to get the CPU time of the thread the
task-runner is executing on.
PlatformThreadId GetThreadIdForTesting ()
void PostTask (std::function<void ()> )
TaskRunner implementation.
These methods just proxy to the underlying task_runner_.
void PostDelayedTask (std::function<void ()> , uint32_t delay_ms)
void AddFileDescriptorWatch (PlatformHandle , std::function<void ()> )
void RemoveFileDescriptorWatch (PlatformHandle )
bool RunsTasksOnCurrentThread ()
MaybeLockFreeTaskRunner * get ()
Returns a pointer to the MaybeLockFreeTaskRunner, which is valid for the
lifetime of this ThreadTaskRunner object (unless this object is moved-from,
in which case the pointer remains valid for the lifetime of the new owning
ThreadTaskRunner).
Warning: do not call Quit() on the returned runner pointer, the termination
should be handled exclusively by this class' destructor.
Defined at line 67 of file ../../third_party/perfetto/include/perfetto/ext/base/thread_task_runner.h