WaitForMultipleObjects function kernel32
Waits until one or all of the specified objects are in the signaled state or the time-out interval elapses.
To learn more, see learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects.
Implementation
Win32Result<WAIT_EVENT> WaitForMultipleObjects(
int nCount,
Pointer<Pointer> lpHandles,
bool bWaitAll,
int dwMilliseconds,
) {
resolveGetLastError();
final result_ = _WaitForMultipleObjects(
nCount,
lpHandles,
bWaitAll ? TRUE : FALSE,
dwMilliseconds,
);
return .new(value: .new(result_), error: GetLastError());
}