Clean up more code

This commit is contained in:
Justine Tunney 2024-09-15 02:45:16 -07:00
parent baf70af780
commit 949c398327
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 108 additions and 107 deletions

View file

@ -131,15 +131,15 @@ static textwindows int __proc_wait(int pid, int *wstatus, int options,
// perform blocking operation
uint32_t wi;
uintptr_t sem;
uintptr_t event;
struct PosixThread *pt = _pthread_self();
pt->pt_blkmask = waitmask;
pt->pt_semaphore = sem = CreateSemaphore(0, 0, 1, 0);
atomic_store_explicit(&pt->pt_blocker, PT_BLOCKER_SEM,
pt->pt_event = event = CreateEvent(0, 0, 0, 0);
atomic_store_explicit(&pt->pt_blocker, PT_BLOCKER_EVENT,
memory_order_release);
wi = WaitForMultipleObjects(2, (intptr_t[2]){hWaitObject, sem}, 0, -1u);
wi = WaitForMultipleObjects(2, (intptr_t[2]){hWaitObject, event}, 0, -1u);
atomic_store_explicit(&pt->pt_blocker, 0, memory_order_release);
CloseHandle(sem);
CloseHandle(event);
// log warning if handle unexpectedly closed
if (wi & kNtWaitAbandoned) {