class TaskQueue

Declaration

class TaskQueue { /* full declaration omitted */ };

Description

TaskQueue executes serialized work on a user-defined Thread Pool. It guarantees that if task B is enqueued after task A, task B begins after task A completes and there is no overlap between the two.

Declared at: llvm/include/llvm/Support/TaskQueue.h:34

Method Overview

  • public TaskQueue(llvm::ThreadPool & Scheduler)
  • public template <typename Callable>std::future<typename std::result_of<Callable ()>::type> async(Callable && C)
  • public ~TaskQueue()

Methods

TaskQueue(llvm::ThreadPool& Scheduler)

Description

Construct a task queue with no work.

Declared at: llvm/include/llvm/Support/TaskQueue.h:69

Parameters

llvm::ThreadPool& Scheduler

template <typename Callable>
std::future<
    typename std::result_of<Callable()>::type>
async(Callable&& C)

Description

Asynchronous submission of a task to the queue. The returned future can be used to wait for the task (and all previous tasks that have not yet completed) to finish.

Declared at: llvm/include/llvm/Support/TaskQueue.h:81

Templates

Callable

Parameters

Callable&& C

~TaskQueue()

Description

Blocking destructor: the queue will wait for all work to complete.

Declared at: llvm/include/llvm/Support/TaskQueue.h:72