LLVM 17.0.0git
Public Member Functions | List of all members
llvm::ThreadPoolTaskGroup Class Reference

A group of tasks to be run on a thread pool. More...

#include "llvm/Support/ThreadPool.h"

Public Member Functions

 ThreadPoolTaskGroup (ThreadPool &Pool)
 The ThreadPool argument is the thread pool to forward calls to.
 
 ~ThreadPoolTaskGroup ()
 Blocking destructor: will wait for all the tasks in the group to complete by calling ThreadPool::wait().
 
template<typename Function , typename... Args>
auto async (Function &&F, Args &&...ArgList)
 Calls ThreadPool::async() for this group.
 
void wait ()
 Calls ThreadPool::wait() for this group.
 

Detailed Description

A group of tasks to be run on a thread pool.

Thread pool tasks in different groups can run on the same threadpool but can be waited for separately. It is even possible for tasks of one group to submit and wait for tasks of another group, as long as this does not form a loop.

Definition at line 224 of file ThreadPool.h.

Constructor & Destructor Documentation

◆ ThreadPoolTaskGroup()

llvm::ThreadPoolTaskGroup::ThreadPoolTaskGroup ( ThreadPool Pool)
inline

The ThreadPool argument is the thread pool to forward calls to.

Definition at line 227 of file ThreadPool.h.

◆ ~ThreadPoolTaskGroup()

llvm::ThreadPoolTaskGroup::~ThreadPoolTaskGroup ( )
inline

Blocking destructor: will wait for all the tasks in the group to complete by calling ThreadPool::wait().

Definition at line 231 of file ThreadPool.h.

References wait().

Member Function Documentation

◆ async()

template<typename Function , typename... Args>
auto llvm::ThreadPoolTaskGroup::async ( Function &&  F,
Args &&...  ArgList 
)
inline

Calls ThreadPool::async() for this group.

Definition at line 235 of file ThreadPool.h.

References llvm::ThreadPool::async(), and F.

◆ wait()

void llvm::ThreadPoolTaskGroup::wait ( )
inline

Calls ThreadPool::wait() for this group.

Definition at line 241 of file ThreadPool.h.

References llvm::ThreadPool::wait().

Referenced by ~ThreadPoolTaskGroup().


The documentation for this class was generated from the following file: