![]() |
|
Architecture-specific thread function calls. More...
Include dependency graph for threads.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | ARCH_SPIN_PAUSE() |
| ARCH_SPIN_PAUSE – 'pause' on x86, 'yield' on arm. | |
Enumerations | |
| enum | ArchThreadPriority { ArchThreadPriorityLowest , ArchThreadPriorityLow } |
| Specifies a reduced-priority level for ArchSetThisThreadPriority(). More... | |
Functions | |
| ARCH_API bool | ArchIsMainThread () |
| Return true if the calling thread is the main thread, false otherwise. | |
| ARCH_API std::thread::id | ArchGetMainThreadId () |
| Return the std::thread_id for the thread arch considers to be the "main" thread. | |
| ARCH_API bool | ArchSetThisThreadName (char const *name) |
| Set the name of the calling thread as UTF-8 text. | |
| ARCH_API std::string | ArchGetThisThreadName () |
| Return the name of the calling thread as a UTF-8 string, as previously set either by ArchSetThisThreadName() or by another entity calling the underlying OS thread naming APIs. | |
| ARCH_API bool | ArchSetThisThreadPriority (ArchThreadPriority priority) |
Lower the priority of the calling thread to priority. | |
Architecture-specific thread function calls.
Definition in file threads.h.
| #define ARCH_SPIN_PAUSE | ( | ) |
| enum ArchThreadPriority |
Specifies a reduced-priority level for ArchSetThisThreadPriority().
Enumerators are ordered ascending by priority, so 'a < b' means "a is lower priority than b".
| ARCH_API std::thread::id ArchGetMainThreadId | ( | ) |
Return the std::thread_id for the thread arch considers to be the "main" thread.
| ARCH_API std::string ArchGetThisThreadName | ( | ) |
Return the name of the calling thread as a UTF-8 string, as previously set either by ArchSetThisThreadName() or by another entity calling the underlying OS thread naming APIs.
Return an empty string if the name cannot be retrieved.
| ARCH_API bool ArchSetThisThreadName | ( | char const * | name | ) |
Set the name of the calling thread as UTF-8 text.
The name is typically visible in debuggers and OS tools. Return true if the name was set, possibly after truncation (see below). Return false if name is null, if the OS rejected the name, or if the platform provides no thread naming facility.
| ARCH_API bool ArchSetThisThreadPriority | ( | ArchThreadPriority | priority | ) |
Lower the priority of the calling thread to priority.
Return true if the priority was successfully changed, false if the thread is already at or below the requested level, if the request failed, or if the platform has no thread priority facility. This is a one-way operation – there is no facility to raise priority back to the inherited default, and calling this function will never raise priority above the current level.