Browse Source

need more than 1 usec sleep to be effective.

David Rose 14 years ago
parent
commit
0eb47e3811
1 changed files with 3 additions and 3 deletions
  1. 3 3
      direct/src/plugin/p3dX11SplashWindow.cxx

+ 3 - 3
direct/src/plugin/p3dX11SplashWindow.cxx

@@ -666,11 +666,11 @@ subprocess_run() {
       FD_ZERO(&fds);
       FD_ZERO(&fds);
       FD_SET(read_fd, &fds);
       FD_SET(read_fd, &fds);
       
       
+      // Sleep a bit to yield the timeslice if there's nothing new.
       struct timeval tv;
       struct timeval tv;
       tv.tv_sec = 0;
       tv.tv_sec = 0;
-      tv.tv_usec = 1;  // Sleep a bit to yield the timeslice if there's
-      // nothing new.
-      
+      tv.tv_usec = 1000;   // 1 usec is not enough.
+
       int result = select(read_fd + 1, &fds, NULL, NULL, &tv);
       int result = select(read_fd + 1, &fds, NULL, NULL, &tv);
       if (result > 0) {
       if (result > 0) {
         // There is some noise on the pipe, so read it.
         // There is some noise on the pipe, so read it.