From: root Date: Tue, 31 Jan 2006 21:35:39 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=c4f2f3eda7c44e921b05bb67fd512833411cb3dc;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index deb963f2..eb4e7a87 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,8 @@ TODO: xim "how to" faq entry - changed interpretation of [alpha] colour prefix. - +option now really sets the option to default, instead of using the resource value. + - the linux yield hack is back, now using usleep, and enabled only on + __linux__. - further round trip eliminations in the !XFT case by remembering the colour components. - plain scrollbar works better with -sr. diff --git a/src/command.C b/src/command.C index dbf2aaf1..9d8b3159 100644 --- a/src/command.C +++ b/src/command.C @@ -1092,6 +1092,24 @@ rxvt_term::slip_wheel_cb (time_watcher &w) } #endif +#if LINUX_YIELD_HACK +static struct event_handler +{ + check_watcher yield_ev; + + void yield_cb (check_watcher &w) + { + usleep (0); + w.stop (); + } + + event_handler () + : yield_ev (this, &event_handler::yield_cb) + { + } +} event_handler; +#endif + bool rxvt_term::pty_fill () { @@ -1116,9 +1134,9 @@ rxvt_term::pty_fill () } else if (r < 0 && (errno == EAGAIN || errno == EINTR)) { -#if HAVE_SCHED_YIELD +#if LINUX_YIELD_HACK if (display->is_local) - event_handler.cw_yield.start (); + event_handler.yield_ev.start (); #endif } else diff --git a/src/feature.h b/src/feature.h index a0cbc33d..cc6be64c 100644 --- a/src/feature.h +++ b/src/feature.h @@ -380,5 +380,15 @@ */ #define VISUAL_BELL_DURATION .020 +/*--------------------------------OTHER---------------------------------*/ + +/* + * Enable the linux yield/usleep hack, which can dramatically improve + * performance without hurting. See command.C for details. + */ +#if __linux__ +# define LINUX_YIELD_HACK 1 +#endif + #endif