WaitForSingleObject function kernel32
Waits until the specified object is in the signaled state or the time-out interval elapses.
To learn more, see learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject.
Implementation
Win32Result<WAIT_EVENT> WaitForSingleObject(
HANDLE hHandle,
int dwMilliseconds,
) {
resolveGetLastError();
final result_ = _WaitForSingleObject(hHandle, dwMilliseconds);
return .new(value: .new(result_), error: GetLastError());
}