15 #ifndef LLVM_SUPPORT_THREADING_H 16 #define LLVM_SUPPORT_THREADING_H 19 #include "llvm/Config/llvm-config.h" 27 #define LLVM_THREADING_USE_STD_CALL_ONCE 1 28 #elif defined(LLVM_ON_UNIX) && \ 29 (defined(_LIBCPP_VERSION) || \ 30 !(defined(__NetBSD__) || defined(__OpenBSD__) || \ 31 (defined(__ppc__) || defined(__PPC__)))) 35 #define LLVM_THREADING_USE_STD_CALL_ONCE 1 37 #define LLVM_THREADING_USE_STD_CALL_ONCE 0 40 #if LLVM_THREADING_USE_STD_CALL_ONCE 66 unsigned RequestedStackSize = 0);
68 #if LLVM_THREADING_USE_STD_CALL_ONCE 74 enum InitStatus { Uninitialized = 0,
Wait = 1, Done = 2 };
101 #if LLVM_THREADING_USE_STD_CALL_ONCE 103 std::forward<Args>(ArgList)...);
108 if (old_val == Uninitialized) {
109 std::forward<Function>(
F)(std::forward<Args>(ArgList)...);
119 while (tmp != Done) {
void set_thread_name(const Twine &Name)
Set the name of the current thread.
This class represents lattice values for constants.
unsigned heavyweight_hardware_concurrency()
Get the amount of currency to use for tasks requiring significant memory or other resources...
#define TsanHappensAfter(cv)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
uint32_t get_max_thread_name_length()
Get the maximum length of a thread name on this platform.
void get_thread_name(SmallVectorImpl< char > &Name)
Get the name of the current thread.
#define TsanHappensBefore(cv)
void call_once(once_flag &flag, Function &&F, Args &&... ArgList)
Execute the function specified as a parameter once.
std::error_code status(const Twine &path, file_status &result, bool follow=true)
Get file status as if by POSIX stat().
bool llvm_is_multithreaded()
Returns true if LLVM is compiled with support for multi-threading, and false otherwise.
cas_flag CompareAndSwap(volatile cas_flag *ptr, cas_flag new_value, cas_flag old_value)
uint64_t get_threadid()
Return the current thread id, as used in various OS system calls.
void llvm_execute_on_thread(void(*UserFn)(void *), void *UserData, unsigned RequestedStackSize=0)
llvm_execute_on_thread - Execute the given UserFn on a separate thread, passing it the provided UserD...
#define TsanIgnoreWritesBegin()
#define TsanIgnoreWritesEnd()
ProcessInfo Wait(const ProcessInfo &PI, unsigned SecondsToWait, bool WaitUntilTerminates, std::string *ErrMsg=nullptr)
This function waits for the process specified by PI to finish.
unsigned hardware_concurrency()
Get the number of threads that the current program can execute concurrently.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.