clang-tools 19.0.0git
Classes | Namespaces | Functions
Threading.h File Reference
#include "support/Context.h"
#include "llvm/ADT/FunctionExtras.h"
#include "llvm/ADT/Twine.h"
#include <atomic>
#include <cassert>
#include <condition_variable>
#include <future>
#include <memory>
#include <mutex>
#include <optional>
#include <thread>
#include <vector>

Go to the source code of this file.

Classes

class  clang::clangd::Semaphore
 Limits the number of threads that can acquire the lock at the same time. More...
 
class  clang::clangd::Deadline
 A point in time we can wait for. More...
 
class  clang::clangd::Notification
 A threadsafe flag that is initially clear. More...
 
class  clang::clangd::AsyncTaskRunner
 Runs tasks on separate (detached) threads and wait for all tasks to finish. More...
 
class  clang::clangd::Memoize< Container >
 Memoize is a cache to store and reuse computation results based on a key. More...
 
class  clang::clangd::PeriodicThrottler
 Used to guard an operation that should run at most every N seconds. More...
 

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::clangd
 

Functions

Deadline clang::clangd::timeoutSeconds (std::optional< double > Seconds)
 Makes a deadline from a timeout in seconds. std::nullopt means wait forever.
 
void clang::clangd::wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D)
 Wait once on CV for the specified duration.
 
template<typename Func >
bool clang::clangd::wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D, Func F)
 Waits on a condition variable until F() is true or D expires.
 
template<typename T >
std::future< T > clang::clangd::runAsync (llvm::unique_function< T()> Action)
 Runs Action asynchronously with a new std::thread.