… | |
… | |
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 |
|
|
1100 | static 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. |
|
|
1109 | |
|
|
1110 | struct timespec ts = { 0, 0 }; |
|
|
1111 | nanosleep (&ts, 0); |
|
|
1112 | |
|
|
1113 | w.stop (); |
|
|
1114 | } |
|
|
1115 | |
|
|
1116 | event_handler () |
|
|
1117 | : yield_ev (this, &event_handler::yield_cb) |
|
|
1118 | { |
|
|
1119 | } |
|
|
1120 | } event_handler; |
|
|
1121 | #endif |
|
|
1122 | |
1095 | bool |
1123 | bool |
1096 | rxvt_term::pty_fill () |
1124 | rxvt_term::pty_fill () |
1097 | { |
1125 | { |
1098 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1126 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1099 | |
1127 | |
… | |
… | |
1114 | cmdbuf_endp += r; |
1142 | cmdbuf_endp += r; |
1115 | return true; |
1143 | return true; |
1116 | } |
1144 | } |
1117 | else if (r < 0 && (errno == EAGAIN || errno == EINTR)) |
1145 | else if (r < 0 && (errno == EAGAIN || errno == EINTR)) |
1118 | { |
1146 | { |
1119 | #if HAVE_SCHED_YIELD |
1147 | #if LINUX_YIELD_HACK |
1120 | if (display->is_local) |
1148 | if (display->is_local) |
1121 | event_handler.cw_yield.start (); |
1149 | event_handler.yield_ev.start (); |
1122 | #endif |
1150 | #endif |
1123 | } |
1151 | } |
1124 | else |
1152 | else |
1125 | { |
1153 | { |
1126 | pty_ev.stop (); |
1154 | pty_ev.stop (); |