clang-tools  14.0.0git
Public Member Functions | List of all members
clang::clangd::AsyncTaskRunner Class Reference

Runs tasks on separate (detached) threads and wait for all tasks to finish. More...

#include <Threading.h>

Public Member Functions

 ~AsyncTaskRunner ()
 Destructor waits for all pending tasks to finish. More...
 
void wait () const
 
LLVM_NODISCARD bool wait (Deadline D) const
 
void runAsync (const llvm::Twine &Name, llvm::unique_function< void()> Action)
 

Detailed Description

Runs tasks on separate (detached) threads and wait for all tasks to finish.

Objects that need to spawn threads can own an AsyncTaskRunner to ensure they all complete on destruction.

Definition at line 106 of file Threading.h.

Constructor & Destructor Documentation

◆ ~AsyncTaskRunner()

clang::clangd::AsyncTaskRunner::~AsyncTaskRunner ( )

Destructor waits for all pending tasks to finish.

Definition at line 65 of file Threading.cpp.

References wait().

Member Function Documentation

◆ runAsync()

void clang::clangd::AsyncTaskRunner::runAsync ( const llvm::Twine &  Name,
llvm::unique_function< void()>  Action 
)

Definition at line 73 of file Threading.cpp.

References Action, and Name.

◆ wait() [1/2]

void clang::clangd::AsyncTaskRunner::wait ( ) const
inline

◆ wait() [2/2]

bool clang::clangd::AsyncTaskRunner::wait ( Deadline  D) const

Definition at line 67 of file Threading.cpp.

References ns1::ns2::D, and clang::clangd::wait().


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