We use GetQueuedCompletionStatus(Ex) to sleep the thread until the next timer expires (provided that no other events happen before that). However after waking up from a sleep the GetTickCount() return value may not immediately reflect that some time has passed. This happens because gqcs can sometimes sleep for periods shorter than the GetTickCount clock resulution. This patch changes time tracking so the amount of time waited by gqcs is taken into account. This has the following advantages: * Excessive loop iterations are avoided. * Small timeouts are fired more precisely. * The `loop-stop` test that used to be flaky on Windows now passes consistently. |
||
|---|---|---|
| .. | ||
| stdint-msvc2008.h | ||
| tree.h | ||
| uv-bsd.h | ||
| uv-darwin.h | ||
| uv-linux.h | ||
| uv-sunos.h | ||
| uv-unix.h | ||
| uv-win.h | ||