*** empty log message ***
authorroot <root>
Tue, 31 Jan 2006 21:47:56 +0000 (21:47 +0000)
committerroot <root>
Tue, 31 Jan 2006 21:47:56 +0000 (21:47 +0000)
src/command.C

index 9d8b31591bcfbb16a52aa2c56189bc46b0b1ee14..c59d16f595b94ab672ae44541e97984c454c33ca 100644 (file)
 
 #include <csignal>
 
+#if LINUX_YIELD_HACK
+# include <ctime>
+#endif
+
 /*----------------------------------------------------------------------*/
 
 #define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
@@ -1099,7 +1103,13 @@ static struct event_handler
   
   void yield_cb (check_watcher &w)
   {
-    usleep (0);
+    // this should really be sched_yield(), but the linux guys thought
+    // that giving a process calling sched_yield () less cpu time than
+    // ones with high nice levels.
+
+    struct timespec ts = { 0, 0 };
+    nanosleep (&ts, 0);
+
     w.stop ();
   }