|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Thread implementation abstraction that handles differences between std::jthread and std::thread. More...
#include <thread_impl.h>

Public Types | |
| using | thread_type = std::thread |
| using | stop_token_type = std::atomic<bool> |
| using | stop_source_type = std::atomic<bool> |
Public Member Functions | |
| thread_impl ()=default | |
| ~thread_impl ()=default | |
| thread_impl (const thread_impl &)=delete | |
| thread_impl & | operator= (const thread_impl &)=delete |
| thread_impl (thread_impl &&)=default | |
| thread_impl & | operator= (thread_impl &&)=default |
| template<typename F > | |
| void | start_thread (F &&func) |
| Create and start a thread with the given function. | |
| void | request_stop () |
| Request thread to stop. | |
| bool | stop_requested () const |
| Check if stop has been requested. | |
| void | join () |
| Join the thread. | |
| void | detach () |
| Detach the thread. | |
| bool | joinable () const |
| Check if thread is joinable. | |
| thread_impl ()=default | |
| ~thread_impl ()=default | |
| thread_impl (const thread_impl &)=delete | |
| thread_impl & | operator= (const thread_impl &)=delete |
| thread_impl (thread_impl &&)=default | |
| thread_impl & | operator= (thread_impl &&)=default |
| template<typename F > | |
| void | start_thread (F &&func) |
| Create and start a thread with the given function. | |
| void | request_stop () |
| Request thread to stop. | |
| bool | stop_requested () const |
| Check if stop has been requested. | |
| void | join () |
| Join the thread. | |
| void | detach () |
| Detach the thread. | |
| bool | joinable () const |
| Check if thread is joinable. | |
Private Attributes | |
| std::unique_ptr< thread_type > | thread_ |
| std::unique_ptr< stop_token_type > | stop_requested_ |
Thread implementation abstraction that handles differences between std::jthread and std::thread.
This class encapsulates the conditional compilation complexity for thread management, providing a unified interface regardless of C++20 jthread availability.
Definition at line 31 of file thread_impl.h.
| typedef std::atomic< bool > kcenon::thread::detail::thread_impl::stop_source_type = std::atomic<bool> |
Definition at line 33 of file thread_impl.h.
| typedef std::atomic< bool > kcenon::thread::detail::thread_impl::stop_token_type = std::atomic<bool> |
Definition at line 32 of file thread_impl.h.
| typedef std::thread kcenon::thread::detail::thread_impl::thread_type = std::thread |
Definition at line 31 of file thread_impl.h.
|
default |
|
default |
|
delete |
|
default |
|
default |
|
default |
|
delete |
|
default |
|
inline |
Detach the thread.
Definition at line 100 of file thread_impl.h.
References thread_.
|
inline |
|
inline |
|
inline |
|
inlinenodiscard |
|
inlinenodiscard |
|
delete |
|
delete |
|
default |
|
default |
|
inline |
Request thread to stop.
Definition at line 65 of file thread_impl.h.
References stop_requested_.
|
inline |
Request thread to stop.
Definition at line 72 of file thread_impl.h.
References stop_requested_.
|
inline |
Create and start a thread with the given function.
Definition at line 48 of file thread_impl.h.
References stop_requested_, and thread_.
|
inline |
Create and start a thread with the given function.
Definition at line 55 of file thread_impl.h.
References stop_requested_, and thread_.
|
inlinenodiscard |
Check if stop has been requested.
Definition at line 80 of file thread_impl.h.
References stop_requested_.
|
inlinenodiscard |
Check if stop has been requested.
Definition at line 87 of file thread_impl.h.
References stop_requested_.
|
private |
Definition at line 119 of file thread_impl.h.
Referenced by request_stop(), start_thread(), and stop_requested().
|
private |
Definition at line 114 of file thread_impl.h.
Referenced by detach(), join(), joinable(), and start_thread().