Browse Source

Fix cloggage of the pipe communicating with the forked X11 splash window subprocess

rdb 10 years ago
parent
commit
12af94707f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      direct/src/plugin/p3dX11SplashWindow.cxx

+ 5 - 2
direct/src/plugin/p3dX11SplashWindow.cxx

@@ -681,10 +681,13 @@ subprocess_run() {
       }
       }
     }
     }
 
 
-    if (input_ready) {
+    do {
+      // Empty the pipe of whatever is in it.
       receive_command();
       receive_command();
-    }
+      input_ready = _pipe_read.has_gdata();
+    } while (input_ready);
 
 
+    // Sleep a good amount in order not to lock up the system.
     struct timespec req;
     struct timespec req;
     req.tv_sec = 0;
     req.tv_sec = 0;
     req.tv_nsec = 50000000;  // 50 ms
     req.tv_nsec = 50000000;  // 50 ms