13#include "../utility/utility.hpp"
14#include "../macros.hpp"
22#include <unordered_map>
26hi_export_module(hikogui.conurrency.thread : intf);
28hi_export
namespace hi {
inline namespace v1 {
32inline unfair_mutex thread_names_mutex = {};
65 hilet lock = std::scoped_lock(detail::thread_names_mutex);
66 hilet
it = detail::thread_names.find(
id);
67 if (
it != detail::thread_names.
end()) {
70 return std::format(
"{}",
id);
Functions and types for accessing operating system threads.
Definition of the unfair_mutex.
std::vector< bool > process_affinity_mask()
Get the current process CPU affinity mask.
std::string get_thread_name(thread_id id) noexcept
Get the thread name of a thread id.
Definition thread_intf.hpp:63
void set_thread_name(std::string_view name) noexcept
Set the name of the current thread.
std::vector< bool > set_thread_affinity_mask(std::vector< bool > const &mask)
Set the current thread CPU affinity mask.
std::size_t current_cpu_id() noexcept
Get the current CPU id.
std::size_t advance_thread_affinity(std::size_t &cpu) noexcept
Advance thread affinity to the next CPU.
Definition thread_intf.hpp:122
std::vector< bool > set_thread_affinity(std::size_t cpu_id)
Set the current thread CPU affinity to a single CPU.
Definition thread_intf.hpp:104
thread_id current_thread_id() noexcept
Get the current thread id.
@ end
Start from the end of the file.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Exception thrown during an operating system call.
Definition exception_intf.hpp:183