#include <csignal>
+#if LINUX_YIELD_HACK
+# include <ctime>
+#endif
+
/*----------------------------------------------------------------------*/
#define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
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 ();
}