#include "support/Threading.h"
#include "support/Trace.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/thread.h"
#include <atomic>
#include <optional>
#include <thread>
#ifdef __USE_POSIX
#include <pthread.h>
#elif defined(__APPLE__)
#include <sys/resource.h>
#elif defined(_WIN32)
#include <windows.h>
#endif
namespace clang {
namespace clangd {
void Notification::notify() { … }
bool Notification::wait(Deadline D) const { … }
Semaphore::Semaphore(std::size_t MaxLocks) : … { … }
bool Semaphore::try_lock() { … }
void Semaphore::lock() { … }
void Semaphore::unlock() { … }
AsyncTaskRunner::~AsyncTaskRunner() { … }
bool AsyncTaskRunner::wait(Deadline D) const { … }
void AsyncTaskRunner::runAsync(const llvm::Twine &Name,
llvm::unique_function<void()> Action) { … }
Deadline timeoutSeconds(std::optional<double> Seconds) { … }
void wait(std::unique_lock<std::mutex> &Lock, std::condition_variable &CV,
Deadline D) { … }
bool PeriodicThrottler::operator()() { … }
}
}