Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-06-06 17:18:53 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-06-06 17:18:53 +0300
commit83834110a0279c228c5c7e232a5d7ce01dd04d3e (patch)
tree20c41a1fc5d721ebe45c0255fe83a989ca9a2458 /winsup/cygwin
parent7239bb7b3ded5ab961dc56dc346d8ab83660ba29 (diff)
Fix condition in select which results in busy loop.
The check for current timestamp > start timestamp has an unwelcome side effect: The loop is not left as long as the current timestamp hasn't been incremented. This leads to busy loops of about one tick (10 to 16 ms per MSDN). This fixes https://cygwin.com/ml/cygwin/2016-05/msg00327.html Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index c63eaeff1..69391d8e7 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -211,7 +211,7 @@ select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
{
select_printf ("recalculating us");
LONGLONG now = gtod.usecs ();
- if (now > (start_time + us))
+ if (now >= (start_time + us))
{
select_printf ("timed out after verification");
/* Set descriptor bits to zero per POSIX. */