Class ThreadBase

Inheritance Relationships

Derived Types

Class Documentation

class ThreadBase

A base thread object, with simular api to jthread. In order to use this, use the platform specific portal/core/hal/thread.h Thread

Subclassed by portal::LinuxThread, portal::MacOSThread, portal::WindowsThread

Public Functions

ThreadBase() = default
inline explicit ThreadBase(const ThreadSpecification &spec)
virtual ~ThreadBase()
ThreadBase(const ThreadBase&) = delete
ThreadBase(ThreadBase&&) noexcept = default
ThreadBase &operator=(const ThreadBase&) = delete
ThreadBase &operator=(ThreadBase &&other) noexcept
bool joinable() const noexcept
void join()
void detach()
std::thread::id get_id() const noexcept
std::string get_name() const noexcept
bool request_stop() noexcept

Protected Functions

void try_cancel_and_join()

Protected Attributes

ThreadSpecification spec = {}
std::jthread thread

Protected Static Functions

template<typename F, typename ...Args>
static inline auto make_callable(F &&f, Args&&... args)
static void set_name(const std::string &name)