Add comments

This commit is contained in:
Attila Uygun 2023-06-06 23:46:03 +02:00
parent 0876203d82
commit 05b86a38c1
2 changed files with 7 additions and 3 deletions

View File

@ -20,6 +20,10 @@ void PostTaskAndReplyRelay(base::Location from,
namespace base { namespace base {
// The task runner that belongs to the thread it's created in. Tasks to be run
// on a specific thread can be posted to this task runner.
// TaskRunner::GetThreadLocalTaskRunner()->SingleConsumerRun() is expected to be
// periodically called.
thread_local std::unique_ptr<TaskRunner> TaskRunner::thread_local_task_runner; thread_local std::unique_ptr<TaskRunner> TaskRunner::thread_local_task_runner;
void TaskRunner::CreateThreadLocalTaskRunner() { void TaskRunner::CreateThreadLocalTaskRunner() {

View File

@ -34,9 +34,9 @@ void ReplyAdapter(std::function<void(ReturnType)> callback,
// Runs queued tasks (in the form of Closure objects). All methods are // Runs queued tasks (in the form of Closure objects). All methods are
// thread-safe and can be called on any thread. // thread-safe and can be called on any thread.
// Tasks run in FIFO order. When consumed concurrently by multiple threads, it // Tasks run in FIFO order when consumed by a single thread. When consumed
// doesn't guarantee whether tasks overlap, or whether they run on a particular // concurrently by multiple threads, it doesn't guarantee whether tasks overlap,
// thread. // or whether they run on a particular thread.
class TaskRunner { class TaskRunner {
public: public:
TaskRunner() = default; TaskRunner() = default;