Apple: Add pthread implementation of Thread class
This allows Apple platforms to override the default stack size of a thread in the WorkerThreadPool, which is 512KiB by default. This must be increased, as SPIRV-Cross, used by the Metal driver, can use deeply nested stacks, as can debug builds.
This commit is contained in:
@@ -35,6 +35,11 @@
|
||||
#include "core/os/thread.h"
|
||||
#include "core/string/ustring.h"
|
||||
|
||||
#if defined(PLATFORM_THREAD_OVERRIDE) && defined(__APPLE__)
|
||||
void init_thread_posix() {
|
||||
}
|
||||
#else
|
||||
|
||||
#ifdef PTHREAD_BSD_SET_NAME
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
@@ -73,4 +78,6 @@ void init_thread_posix() {
|
||||
Thread::_set_platform_functions({ .set_name = set_name });
|
||||
}
|
||||
|
||||
#endif // PLATFORM_THREAD_OVERRIDE && __APPLE__
|
||||
|
||||
#endif // UNIX_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user