diff osdep/getch2-win.c @ 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 3d02f6e2a432
children 24003616a623
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());