Add support for macOS. (#745)

This commit is contained in:
squidbus
2025-08-03 08:56:42 -07:00
committed by GitHub
parent ada0db62dc
commit 80e779afd9
47 changed files with 889 additions and 139 deletions
+15
View File
@@ -2,6 +2,15 @@
#include <kernel/xdm.h>
// Use pthreads directly on macOS to be able to increase default stack size.
#ifdef __APPLE__
#define USE_PTHREAD 1
#endif
#ifdef USE_PTHREAD
#include <pthread.h>
#endif
#define CURRENT_THREAD_HANDLE uint32_t(-2)
struct GuestThreadContext
@@ -24,11 +33,17 @@ struct GuestThreadHandle : KernelObject
{
GuestThreadParams params;
std::atomic<bool> suspended;
#ifdef USE_PTHREAD
pthread_t thread;
#else
std::thread thread;
#endif
GuestThreadHandle(const GuestThreadParams& params);
~GuestThreadHandle() override;
uint32_t GetThreadId() const;
uint32_t Wait(uint32_t timeout) override;
};