1 #ifndef LIBJMMCG_CORE_THREAD_WRAPPER_HPP
2 #define LIBJMMCG_CORE_THREAD_WRAPPER_HPP
27 #include "private_/thread_base.hpp"
56 using thread_context_t=TWC;
57 using lock_traits=
typename base_t::lock_traits;
58 using thread_traits=
typename base_t::thread_traits;
59 using os_traits=
typename base_t::os_traits;
60 using exception_type=
typename os_traits::exception_type;
90 explicit __stdcall wrapper(
const typename thread_traits::api_params_type::suspend_period_ms ew_=50)
noexcept(
false)
FORCE_INLINE;
92 explicit __stdcall wrapper(thread_context_t &&thread_context,
const typename thread_traits::api_params_type::suspend_period_ms ew_=50)
noexcept(
false)
FORCE_INLINE;
106 virtual bool __fastcall worker_fn(thread_context_t &context)
noexcept(
false)=0;
114 thread_context_t thread_context_;
125 class thread
final :
public wrapper<API, Mdl,
std::function<
void()>> {
128 using thread_context_t=
typename base_t::thread_context_t;
129 using lock_traits=
typename base_t::lock_traits;
130 using thread_traits=
typename base_t::thread_traits;
131 using os_traits=
typename base_t::os_traits;
132 using exception_type=
typename base_t::exception_type;
144 explicit __stdcall thread(
const typename thread_traits::api_params_type::suspend_period_ms ew_=50)
noexcept(
false)
FORCE_INLINE;
153 template<
class ProcFn>
154 explicit __stdcall thread(ProcFn &&proc_fn,
const typename thread_traits::api_params_type::suspend_period_ms ew_=50)
noexcept(
false)
FORCE_INLINE;
159 bool __fastcall worker_fn(thread_context_t &context)
noexcept(
false)
override;