34#include <NDEVR/String.h>
35#include <NDEVR/Dictionary.h>
36#if NDEVR_SUPPORTS_THREADING
45 static void SetCurrentThreadName(
const String& name);
46 static bool IsPrimaryThread();
47 static void SetPrimaryThreadID(
uint04 primary_thread);
48 static void RequestSleep(
const TimeSpan& interval);
49 static uint04 CurrentThreadID();
50 static uint04 PrimaryThreadID();
51 static void RequestNoSleep(
bool request_no_sleep);
52 static String CurrentThreadName();
54 static void RequestSleep(
uint08 milliseconds);
55 static uint04 s_primary_thread_id;
57#if NDEVR_SUPPORTS_THREADING
62 Thread(
const String& name);
63 Thread(
const Thread& name) =
delete;
69 virtual void stopThread();
70 virtual void requestStopThread();
71 bool isRunning()
const;
72 void forceStop() { m_is_running =
false; }
73 void setIsPrimaryThread(
bool is_primary_thread);
74 virtual bool shouldExitThread()
const;
75 bool isPrimaryThread()
const;
76 const String& threadName()
const {
return m_name; }
77 void setThreadName(
const String& name);
78 static void StopAllThreads();
79 static void ServiceVirtualThreads();
80 static Thread& CurrentThread();
81 static String CurrentThreadName();
82 static void SetCurrentThreadName(
const String& name);
84 const std::thread& self();
89 static uint08 GetThreadCount() {
return s_thread_count; }
90 static void _setThreadName(
const String& name);
93 std::thread* m_tid =
nullptr;
94 uint04 m_thread_id = Constant<uint04>::NaN;
96 volatile bool m_is_running =
false;
97 volatile bool m_is_single_run =
true;
99 volatile static uint04 s_thread_count;
100 static Dictionary<uint04, Thread*> s_thread_map;
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer -Can represent exact integer values 0 thro...
Definition BaseValues.hpp:132
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120