Add SetThreadAffinityMask and SetThreadPriority and thread name for Apple platforms

This commit is contained in:
Wojtek Figat
2023-11-04 14:08:53 +01:00
parent 236e5772ce
commit 50bcbf980e
3 changed files with 25 additions and 6 deletions

View File

@@ -26,6 +26,12 @@ int32 UnixThread::Start(pthread_attr_t& attr)
void* UnixThread::ThreadProc(void* pThis)
{
auto thread = (UnixThread*)pThis;
#if PLATFORM_APPLE_FAMILY
// Apple doesn't support creating named thread so assign name here
{
pthread_setname_np(StringAnsi(thread->GetName()).Get());
}
#endif
const int32 exitCode = thread->Run();
return (void*)(uintptr)exitCode;
}