mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-21 01:50:30 +00:00
Clean up more code
This commit is contained in:
parent
baf70af780
commit
949c398327
9 changed files with 108 additions and 107 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue