LLVM 19.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 (ThreadPoolInterface &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 264 of file ThreadPool.h.

Constructor & Destructor Documentation

◆ ThreadPoolTaskGroup()

llvm::ThreadPoolTaskGroup::ThreadPoolTaskGroup ( ThreadPoolInterface Pool)
inline

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

Definition at line 267 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 271 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 275 of file ThreadPool.h.

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

◆ wait()

void llvm::ThreadPoolTaskGroup::wait ( )
inline

Calls ThreadPool::wait() for this group.

Definition at line 281 of file ThreadPool.h.

References llvm::ThreadPoolInterface::wait().

Referenced by ~ThreadPoolTaskGroup().


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