ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.301 by root, Tue Jan 31 21:23:13 2006 UTC vs.
Revision 1.304 by root, Tue Jan 31 22:01:25 2006 UTC

54#ifdef KEYSYM_RESOURCE 54#ifdef KEYSYM_RESOURCE
55# include "keyboard.h" 55# include "keyboard.h"
56#endif 56#endif
57 57
58#include <csignal> 58#include <csignal>
59
60#if LINUX_YIELD_HACK
61# include <ctime>
62#endif
59 63
60/*----------------------------------------------------------------------*/ 64/*----------------------------------------------------------------------*/
61 65
62#define IS_CONTROL(ch) !((ch) & 0xffffff60UL) 66#define IS_CONTROL(ch) !((ch) & 0xffffff60UL)
63 67
1090 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); 1094 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY);
1091 } 1095 }
1092} 1096}
1093#endif 1097#endif
1094 1098
1099#if LINUX_YIELD_HACK
1100static struct event_handler
1101{
1102 check_watcher yield_ev;
1103
1104 void yield_cb (check_watcher &w)
1105 {
1106 // this should really be sched_yield(), but the linux guys thought
1107 // that giving a process calling sched_yield () less cpu time than
1108 // ones with high nice levels is a useful thing to do. It surely is is
1109 // allowed by the sus... as is returning ENOSYS.
1110
1111 struct timespec ts = { 0, 0 };
1112 nanosleep (&ts, 0);
1113
1114 w.stop ();
1115 }
1116
1117 event_handler ()
1118 : yield_ev (this, &event_handler::yield_cb)
1119 {
1120 }
1121} event_handler;
1122#endif
1123
1095bool 1124bool
1096rxvt_term::pty_fill () 1125rxvt_term::pty_fill ()
1097{ 1126{
1098 ssize_t n = cmdbuf_endp - cmdbuf_ptr; 1127 ssize_t n = cmdbuf_endp - cmdbuf_ptr;
1099 1128
1114 cmdbuf_endp += r; 1143 cmdbuf_endp += r;
1115 return true; 1144 return true;
1116 } 1145 }
1117 else if (r < 0 && (errno == EAGAIN || errno == EINTR)) 1146 else if (r < 0 && (errno == EAGAIN || errno == EINTR))
1118 { 1147 {
1119#if HAVE_SCHED_YIELD 1148#if LINUX_YIELD_HACK
1120 if (display->is_local) 1149 if (display->is_local)
1121 event_handler.cw_yield.start (); 1150 event_handler.yield_ev.start ();
1122#endif 1151#endif
1123 } 1152 }
1124 else 1153 else
1125 { 1154 {
1126 pty_ev.stop (); 1155 pty_ev.stop ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines