aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2013-04-06 19:05:16 +0200
committerMarc Hoersken <info@marc-hoersken.de>2013-04-06 19:05:16 +0200
commit2ba0f1373c6d3fdbc268a02d1eefb06ba6fa336b (patch)
tree74275ecb380b4a770775dfc5d76f256bdbca63eb /tests
parentb4fae9d73fece4e9ec7e347f69b84be4da49e94c (diff)
sockfilt.c: Reduce CPU load while running under a Windows PIPE
Diffstat (limited to 'tests')
-rw-r--r--tests/server/sockfilt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 5c7277dfb..1a1eeb3c2 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -643,8 +643,11 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
/* check if there is no data from PIPE input */
if(!PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL))
avail = 0;
- if(!avail)
+ if(!avail) {
FD_CLR(sock, readfds);
+ /* reduce CPU load */
+ Sleep(10);
+ }
} /* check if there is no data from keyboard input */
else if (!_kbhit()) {
/* check if there are INPUT_RECORDs in the input buffer */