39 template <typename F, typename... Args>
40 explicit
ThreadWrapperReg(std::
string name, std::
string componentTag, F&& f, Args&&... args)
42 [n = std::move(name), c = std::move(componentTag), func = std::forward<F>(f)](auto&&... inner) {
44 std::invoke(func, std::forward<
decltype(inner)>(inner)...);
46 std::forward<Args>(args)...)
51#if __cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
64 JThreadWrapperReg() =
default;
66 JThreadWrapperReg(JThreadWrapperReg&&) noexcept = default;
67 auto operator=(JThreadWrapperReg&&) noexcept -> JThreadWrapperReg& = default;
69 JThreadWrapperReg(JThreadWrapperReg const&) = delete;
70 auto operator=(JThreadWrapperReg const&) -> JThreadWrapperReg& = delete;
72 template <typename F, typename... Args>
73 explicit JThreadWrapperReg(std::
string name, std::
string componentTag, F&& f, Args&&... args)
75 [n = std::move(name), c = std::move(componentTag),
76 func = std::forward<F>(f)](std::stop_token st, auto&&... inner) {
77 AutoRegisterCurrentThread guard(n, c);
78 if constexpr (std::is_invocable_v<
decltype(func), std::stop_token,
80 std::invoke(func, std::move(st), std::forward<
decltype(inner)>(inner)...);
81 else if constexpr (std::is_invocable_v<
decltype(func),
decltype(inner)...,
83 std::invoke(func, std::forward<
decltype(inner)>(inner)..., std::move(st));
85 std::invoke(func, std::forward<
decltype(inner)>(inner)...);
87 std::forward<Args>(args)...)
112 template <typename F, typename... Args>
115 [n = std::move(name), c = std::move(componentTag), func = std::forward<F>(f)](auto&&... inner) {
117 std::invoke(func, std::forward<
decltype(inner)>(inner)...);
119 std::forward<Args>(args)...)
RAII guard that registers the current thread on construction and unregisters it on destruction.
PThreadWrapperReg(PThreadWrapperReg &&) noexcept=default
PThreadWrapperReg()=default
ThreadWrapperReg(ThreadWrapperReg &&) noexcept=default
ThreadWrapperReg()=default
ThreadWrapper JThreadWrapper
Owning wrapper around std::jthread with cooperative cancellation (C++20).
RAII wrapper around POSIX threads (Linux only).
Process-wide thread registry, control blocks, and composite registry.
Enhanced thread wrappers: ThreadWrapper, JThreadWrapper, and non-owning views.