changeset 18070:c1e25c011c54

getch2 should wait for input. Fixes 100% CPU usage during cache fill.
author reimar
date Mon, 10 Apr 2006 12:42:10 +0000
parents b644dfdeda48
children 1e144ef9759b
files osdep/getch2-win.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/osdep/getch2-win.c	Mon Apr 10 07:28:14 2006 +0000
+++ b/osdep/getch2-win.c	Mon Apr 10 12:42:10 2006 +0000
@@ -36,6 +36,7 @@
    	int i=0;
     if(!getch2_status)return -1;    
     /*check if there are input events*/
+	WaitForSingleObject(stdin, time);
 	if(!GetNumberOfConsoleInputEvents(stdin,&retval))
 	{
 		printf("getch2: can't get number of input events: %i\n",GetLastError());