|
| | thread_backend ()=default |
| |
| auto | get () noexcept -> std::thread & |
| |
| auto | get () const noexcept -> std::thread const & |
| |
| | thread_backend (std::thread &&t) noexcept |
| |
| | thread_backend (std::thread &&t, native_thread_id tid) noexcept |
| |
| template<typename F , typename... Args> |
| | thread_backend (F &&f, Args &&... args) |
| |
| | thread_backend (thread_backend const &)=delete |
| |
| auto | operator= (thread_backend const &) -> thread_backend &=delete |
| |
| | thread_backend (thread_backend &&other) noexcept |
| |
| auto | operator= (thread_backend &&other) noexcept -> thread_backend & |
| |
| | ~thread_backend () override |
| |
| auto | release () noexcept -> std::thread |
| |
| | operator std::thread () &&noexcept |
| |
| | basic_thread_backend ()=default |
| |
| | basic_thread_backend (std::thread &t) |
| |
| | basic_thread_backend (std::thread &t, native_thread_id tid) |
| |
| virtual | ~basic_thread_backend ()=default |
| |
| void | join () |
| |
| void | detach () |
| |
| auto | joinable () const noexcept -> bool |
| |
| auto | get_id () const noexcept -> id |
| |
| auto | native_handle () noexcept -> native_handle_type |
| |
| auto | set_name (std::string const &name) -> expected< void, std::error_code > |
| |
| auto | get_name () const -> expected< std::string, std::error_code > |
| |
| auto | set_priority (native_thread_priority priority) -> expected< void, std::error_code > |
| |
| auto | set_scheduling_policy (native_scheduling_policy policy, native_thread_priority priority) -> expected< void, std::error_code > |
| |
| auto | configure (native_scheduling_config const &config) -> expected< void, std::error_code > |
| |
| auto | configure (native_thread_config const &config) -> expected< void, std::error_code > |
| |
| auto | set_nice_value (int nice_value) -> expected< void, std::error_code > |
| |
| auto | get_nice_value () const -> expected< int, std::error_code > |
| |
| auto | set_affinity (native_thread_affinity const &affinity) -> expected< void, std::error_code > |
| |
| auto | get_affinity () const -> expected< native_thread_affinity, std::error_code > |
| |
| auto | native_id () const noexcept -> native_thread_id |
| |
Owning wrapper around std::thread with RAII join-on-destroy semantics.
Extends basic_thread_backend to provide an owning, movable, non-copyable wrapper over std::thread. Adds automatic lifetime management: the destructor joins the thread if it is still joinable, which means destruction can block until the thread finishes.
- Copyability / Movability
- Not copyable (copy constructor and copy assignment are deleted).
- Movable. Move construction transfers ownership. Move assignment first joins the currently held thread (blocking!) before taking ownership of the source thread.
- Destruction
- The destructor calls
join() if the thread is joinable. This will block the destroying thread until the managed thread completes. If blocking destruction is undesirable, call detach() or release() before the wrapper goes out of scope.
- release()
- Transfers ownership of the underlying
std::thread out of the wrapper, returning it by value. After release, the wrapper holds a default-constructed (non-joinable) thread and destruction becomes a no-op.
- create_with_config()
- Factory that creates a thread and attempts to set its name and scheduling policy. Failures from
set_name() or set_scheduling_policy() are silently ignored - the thread will still be running but may not have the requested attributes. Check attributes after construction if they are critical.
- Thread Safety
- Not thread-safe. A single thread_backend must not be mutated concurrently from multiple threads.
Definition at line 460 of file thread_backend.hpp.