Initial macOS support (x86_64 with Rosetta 2)

This commit is contained in:
2025-11-08 01:45:47 -07:00
parent f56bd8e2a7
commit cc0a887302
33 changed files with 1281 additions and 4186 deletions

View File

@@ -437,10 +437,13 @@ DWORD WINAPI WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) {
case ObjectType::Process: {
auto po = std::move(obj).downcast<ProcessObject>();
std::unique_lock lk(po->m);
if (po->pidfd == -1) {
if (!po->signaled && !po->waitable) {
// Windows actually allows you to wait on your own process, but why bother?
return WAIT_TIMEOUT;
}
if (po->signaled) {
return WAIT_OBJECT_0;
}
bool ok = doWait(lk, po->cv, [&] { return po->signaled; });
return ok ? WAIT_OBJECT_0 : WAIT_TIMEOUT;
}