clang-tools 20.0.0git
|
PreambleThrottler controls which preambles can build at any given time. More...
#include <TUScheduler.h>
Public Types | |
using | RequestID = unsigned |
using | Callback = llvm::unique_function< void()> |
Public Member Functions | |
virtual | ~PreambleThrottler ()=default |
virtual RequestID | acquire (llvm::StringRef Filename, Callback)=0 |
Attempt to acquire resources to build a file's preamble. | |
virtual void | release (RequestID)=0 |
Abandons the request/releases any resources that have been acquired. | |
PreambleThrottler controls which preambles can build at any given time.
This can be used to limit overall concurrency, and to prioritize some preambles over others. In a distributed environment, a throttler may be able to coordinate resource use across several clangd instances.
This class is threadsafe.
Definition at line 98 of file TUScheduler.h.
using clang::clangd::PreambleThrottler::Callback = llvm::unique_function<void()> |
Definition at line 103 of file TUScheduler.h.
using clang::clangd::PreambleThrottler::RequestID = unsigned |
Definition at line 102 of file TUScheduler.h.
|
virtualdefault |
|
pure virtual |
Attempt to acquire resources to build a file's preamble.
Does not block, may eventually invoke the callback to satisfy the request. If the callback is invoked, release() must be called afterwards.
|
pure virtual |