clang-tools 20.0.0git
|
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. | |
void | wait () const |
bool | wait (Deadline D) const |
void | runAsync (const llvm::Twine &Name, llvm::unique_function< void()> Action) |
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 108 of file Threading.h.
clang::clangd::AsyncTaskRunner::~AsyncTaskRunner | ( | ) |
Destructor waits for all pending tasks to finish.
Definition at line 73 of file Threading.cpp.
References wait().
void clang::clangd::AsyncTaskRunner::runAsync | ( | const llvm::Twine & | Name, |
llvm::unique_function< void()> | Action | ||
) |
Definition at line 81 of file Threading.cpp.
Referenced by clang::clangd::TEST_F().
|
inline |
Definition at line 113 of file Threading.h.
References clang::clangd::Deadline::infinity(), and wait().
Referenced by clang::clangd::TEST_F(), wait(), ~AsyncTaskRunner(), and clang::clangd::BackgroundIndex::~BackgroundIndex().
bool clang::clangd::AsyncTaskRunner::wait | ( | Deadline | D | ) | const |
Definition at line 75 of file Threading.cpp.
References clang::clangd::wait().