43#include <StormByte/error.hxx>
44#include <StormByte/safe/string.hxx>
50#include <system_error>
89 template<typename Rep, typename Period>
90 inline
void Sleep(const
std::chrono::duration<Rep, Period>& duration) {
91 std::this_thread::sleep_for(duration);
115 static constexpr const char*
Name =
"StormByte.System.ThisThread";
127 return "Thread name is too long";
129 return "Thread name operation failed";
131 return "Unknown ThisThread error";
158 struct is_error_code_enum<
StormByte::System::ThisThread::Error>: true_type {};
Calling-thread helpers (the current thread, not a child process).
Definition this_thread.hxx:64
void Sleep(const std::chrono::duration< Rep, Period > &duration)
Suspend the calling thread.
Definition this_thread.hxx:90
Error
ThisThread enumerators.
Definition this_thread.hxx:71
@ TooLong
The name exceeds the platform limit.
Definition this_thread.hxx:73
@ Success
No error.
Definition this_thread.hxx:72
@ Failed
The platform call failed.
Definition this_thread.hxx:74
bool Name(std::string_view name)
Set the calling thread name.
StormByte::Error::Fault LastError() noexcept
Last ThisThread error on this thread.
System module of the StormByte suite.
Definition device.hxx:59
STORMBYTE_FORCE_INLINE std::error_code make_error_code(Device::Error e) noexcept
Builds an std::error_code from Device::Error.
Definition device.hxx:341
const StormByte::Error::Category< ThisThread::Error > & this_thread_category() noexcept
Category singleton for ThisThread::Error.
static constexpr const char * Name
Stable category tag.
Definition this_thread.hxx:115
static STORMBYTE_FORCE_INLINE std::string Message(StormByte::System::ThisThread::Error e)
Text for one ThisThread enumerator.
Definition this_thread.hxx:122
#define STORMBYTE_SYSTEM_PUBLIC
Definition visibility.h:53