clang-tools 19.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
clang::clangd::BackgroundQueue Class Reference

#include <Background.h>

Classes

struct  Stats
 
struct  Task
 A work item on the thread pool's queue. More...
 

Public Member Functions

 BackgroundQueue (std::function< void(Stats)> OnProgress=nullptr)
 
void push (Task)
 
void append (std::vector< Task >)
 
void boost (llvm::StringRef Tag, unsigned NewPriority)
 
void work (std::function< void()> OnIdle=nullptr)
 
void stop ()
 
bool blockUntilIdleForTest (std::optional< double > TimeoutSeconds)
 

Static Public Member Functions

static void preventThreadStarvationInTests ()
 

Detailed Description

Definition at line 69 of file Background.h.

Constructor & Destructor Documentation

◆ BackgroundQueue()

clang::clangd::BackgroundQueue::BackgroundQueue ( std::function< void(Stats)>  OnProgress = nullptr)
inline

Definition at line 93 of file Background.h.

Member Function Documentation

◆ append()

void clang::clangd::BackgroundQueue::append ( std::vector< Task Tasks)

Definition at line 102 of file BackgroundQueue.cpp.

References clang::clangd::BackgroundQueue::Stats::Enqueued.

Referenced by clang::clangd::TEST().

◆ blockUntilIdleForTest()

bool clang::clangd::BackgroundQueue::blockUntilIdleForTest ( std::optional< double >  TimeoutSeconds)

◆ boost()

void clang::clangd::BackgroundQueue::boost ( llvm::StringRef  Tag,
unsigned  NewPriority 
)

Definition at line 117 of file BackgroundQueue.cpp.

References Changes, and Tag.

Referenced by clang::clangd::BackgroundIndex::boostRelated(), and clang::clangd::TEST().

◆ preventThreadStarvationInTests()

void clang::clangd::BackgroundQueue::preventThreadStarvationInTests ( )
static

◆ push()

void clang::clangd::BackgroundQueue::push ( Task  T)

◆ stop()

void clang::clangd::BackgroundQueue::stop ( )

◆ work()

void clang::clangd::BackgroundQueue::work ( std::function< void()>  OnIdle = nullptr)

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