From bfee7773dbcd5219a1fe7f5b126f4ce96557df7d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 31 Jan 2006 21:47:56 +0000 Subject: [PATCH] *** empty log message *** --- src/command.C | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/command.C b/src/command.C index 9d8b3159..c59d16f5 100644 --- a/src/command.C +++ b/src/command.C @@ -57,6 +57,10 @@ #include +#if LINUX_YIELD_HACK +# include +#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 (); } -- 2.34.1