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

@@ -40,10 +40,7 @@ public:
return (AppleThread*)Setup(New<AppleThread>(runnable, name, priority), stackSize);
}
protected:
// [UnixThread]
int32 GetThreadPriority(ThreadPriority priority) override
static int32 GetAppleThreadPriority(ThreadPriority priority)
{
switch (priority)
{
@@ -60,6 +57,14 @@ protected:
}
return 31;
}
protected:
// [UnixThread]
int32 GetThreadPriority(ThreadPriority priority) override
{
return GetAppleThreadPriority(priority);
}
int32 Start(pthread_attr_t& attr) override
{
return pthread_create(&_thread, &attr, ThreadProc, this);