diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index a7f7165163..c31a0b804f 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -2555,13 +2555,13 @@ std::string thread_ctrl::get_name_cached() return *name_cache; } -thread_base::thread_base(native_entry entry, std::string name) +thread_base::thread_base(native_entry entry, std::string name) noexcept : entry_point(entry) , m_tname(make_single_value(std::move(name))) { } -thread_base::~thread_base() +thread_base::~thread_base() noexcept { // Cleanup abandoned tasks: initialize default results and signal this->exec(); @@ -2602,7 +2602,7 @@ bool thread_base::join(bool dtor) const if (i >= 16 && !(i & (i - 1)) && timeout != atomic_wait_timeout::inf) { - sig_log.error(u8"Thread [%s] is too sleepy. Waiting for it %.3fus already!", *m_tname.load(), (utils::get_tsc() - stamp0) / (utils::get_tsc_freq() / 1000000.)); + sig_log.error("Thread [%s] is too sleepy. Waiting for it %.3fus already!", *m_tname.load(), (utils::get_tsc() - stamp0) / (utils::get_tsc_freq() / 1000000.)); } } diff --git a/Utilities/Thread.h b/Utilities/Thread.h index 39285904ee..4350915d70 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -172,9 +172,9 @@ private: friend class named_thread; protected: - thread_base(native_entry, std::string name); + thread_base(native_entry, std::string name) noexcept; - ~thread_base(); + ~thread_base() noexcept; public: // Get CPU cycles since last time this function was called. First call returns 0. @@ -351,7 +351,7 @@ public: // Sets the native thread priority and returns it to zero at destructor struct scoped_priority { - explicit scoped_priority(int prio) + explicit scoped_priority(int prio) noexcept { set_native_priority(prio); } @@ -360,7 +360,7 @@ public: scoped_priority& operator=(const scoped_priority&) = delete; - ~scoped_priority() + ~scoped_priority() noexcept { set_native_priority(0); } @@ -388,7 +388,7 @@ class thread_future_t : public thread_future, result_storage(args)...) , m_func(std::forward(func)) { @@ -417,7 +417,7 @@ public: }; } - ~thread_future_t() + ~thread_future_t() noexcept { if constexpr (!future::empty && !Discard) { @@ -570,7 +570,7 @@ public: named_thread& operator=(const named_thread&) = delete; // Wait for the completion and access result (if not void) - [[nodiscard]] decltype(auto) operator()() + [[nodiscard]] decltype(auto) operator()() noexcept { thread::join(); @@ -581,7 +581,7 @@ public: } // Wait for the completion and access result (if not void) - [[nodiscard]] decltype(auto) operator()() const + [[nodiscard]] decltype(auto) operator()() const noexcept { thread::join(); @@ -593,7 +593,7 @@ public: // Send command to the thread to invoke directly (references should be passed via std::ref()) template - auto operator()(Arg&& arg, Args&&... args) + auto operator()(Arg&& arg, Args&&... args) noexcept { // Overloaded operator() of the Context. constexpr bool v1 = std::is_invocable_v; @@ -667,12 +667,12 @@ public: } // Access thread state - operator thread_state() const + operator thread_state() const noexcept { return static_cast(thread::m_sync.load() & 3); } - named_thread& operator=(thread_state s) + named_thread& operator=(thread_state s) noexcept { if (s == thread_state::created) { @@ -717,7 +717,7 @@ public: } // Context type doesn't need virtual destructor - ~named_thread() + ~named_thread() noexcept { // Assign aborting state forcefully and join thread operator=(thread_state::finished);