Why: Threads#
-
class Thread#
Thread class with priority scheduling.
The Thread class provides thread creation and management with support for priority scheduling and move semantics.
Public Types
Public Functions
-
Thread(std::function<void()>, Priority prio = Priority::None)#
Constructor.
- Parameters:
func – The function to execute in the new thread
prio – The priority level for the thread (default: Priority::None)
-
~Thread()#
Destructor.
-
Thread &operator=(const Thread&) = delete#
Copy assignment operator (deleted - threads cannot be copied).
-
Thread &operator=(Thread &&other)#
Move assignment operator.
- Parameters:
other – The thread to move from
- Returns:
Reference to this thread
-
Priority priority() const#
Get the thread’s priority level.
- Returns:
The current priority of the thread
-
std::string_view prioritystr() const#
Get the thread’s priority as a string.
- Returns:
String representation of the thread’s priority
-
Thread(std::function<void()>, Priority prio = Priority::None)#