65 typedef std::unique_ptr<thread_object_type> thread_object_pointer;
70 thread(
const std::string& aName =
"",
bool aAttachToCurrentThread =
false);
71 thread(std::function<
void()> aExecFunction,
const std::string& aName =
"");
75 const std::string&
name() const noexcept override;
76 bool using_existing_thread() const noexcept;
79 void abort(
bool aWait = true) override;
87 bool started() const noexcept;
88 bool running() const noexcept;
89 bool finished() const noexcept override;
90 bool aborted() const noexcept;
91 bool cancelled() const noexcept;
92 bool error() const noexcept;
95 bool blocked() const noexcept;
96 bool has_thread_object() const noexcept;
98 static
void sleep(const
std::chrono::duration<
double,
std::milli>& aDuration);
100 static uint64_t elapsed_ms() noexcept;
101 static uint64_t elapsed_us() noexcept;
102 static uint64_t elapsed_ns() noexcept;
103 static uint64_t program_elapsed_ms() noexcept;
104 static uint64_t program_elapsed_us() noexcept;
105 static uint64_t program_elapsed_ns() noexcept;
109 bool waitable_ready() const noexcept override;
111 void exec_preamble() override;
116 mutable
std::recursive_mutex iMutex;
117 const
std::
string iName;
118 bool iUsingExistingThread;
121 thread_object_pointer iThreadObject;
123 std::atomic<
std::
size_t> iBlockedCount;