mdbx-test: minor refine actor_poll() for Windows.

Change-Id: Ic1d98ae9e6d8bd7534390b15682f0bc7d1e73fac
This commit is contained in:
Leonid Yuriev 2019-10-12 10:42:27 +03:00
parent 23733bf4af
commit 3ce4c3a0e4

View File

@ -380,7 +380,7 @@ int osal_actor_poll(mdbx_pid_t &pid, unsigned timeout) {
if (pair.second.second <= as_running)
handles.push_back(pair.second.first);
loop:
while (true) {
DWORD rc =
MsgWaitForMultipleObjectsEx((DWORD)handles.size(), &handles[0],
(timeout > 60) ? 60 * 1000 : timeout * 1000,
@ -388,11 +388,11 @@ loop:
if (rc == WAIT_OBJECT_0) {
logging::progress_canary(true);
goto loop;
continue;
}
if (rc == WAIT_OBJECT_0 + 1) {
logging::progress_canary(false);
goto loop;
continue;
}
if (rc >= WAIT_OBJECT_0 + 2 && rc < WAIT_OBJECT_0 + handles.size()) {
@ -411,6 +411,7 @@ loop:
}
return waitstatus2errcode(rc);
}
}
void osal_yield(void) { SwitchToThread(); }