From 26bec60f2efa0b66b5002233d7246b1f69a29b2d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 1 Jan 2006 06:18:20 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 3 ++- autoconf/config.h.in | 3 +++ autoconf/configure.in | 7 ++++++ configure | 55 +++++++++++++++++++++++++++++++++++++++++++ src/command.C | 9 ++++--- 5 files changed, 71 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index b0dbe4eb..2b516614 100644 --- a/Changes +++ b/Changes @@ -28,7 +28,8 @@ WISH: just for fun, do shade and tint with XRender. on a few architectures). Reported by darix. - include one trailing space in rectangular selections to indicate the inserted newline (yeah, weird, but visually more pleasing). - - try to use sched_yield to improve terminal data transfer efficiency. + - try to use sched_yield to (drastically) improve terminal data + transfer efficiency. - further minor cleanups. 6.1 Tue Dec 27 13:23:40 CET 2005 diff --git a/autoconf/config.h.in b/autoconf/config.h.in index b90b4900..4e7f442a 100644 --- a/autoconf/config.h.in +++ b/autoconf/config.h.in @@ -202,6 +202,9 @@ /* Needed to get declarations for msg_control and msg_controllen on Solaris */ #undef __EXTENSIONS__ +/* Define if you have sched-h and sched_yield */ +#undef HAVE_SCHED_YIELD + /* Build shared library version - specify via configure only */ #undef LIBRXVT diff --git a/autoconf/configure.in b/autoconf/configure.in index da11bd45..3daba5a5 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -83,6 +83,13 @@ dnl solaris needs to link libnsl and socket AC_CHECK_FUNC(gethostbyname, [], [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) AC_CHECK_FUNC(socket, [], [AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"])]) +dnl sched_yield to improve terminal efficiency +AC_MSG_CHECKING(for sched_yield support) +AC_TRY_LINK([#include ],[sched_yield ()], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SCHED_YIELD, 1, Define if you have sched-h and sched_yield)], + [AC_MSG_RESULT(no)]) + dnl AC_ENABLE_SHARED(no)dnl# libtool dnl AC_ENABLE_STATIC(yes)dnl# libtool dnl AC_PROG_LIBTOOL()dnl# libtool diff --git a/configure b/configure index fa00e717..6c3664d6 100755 --- a/configure +++ b/configure @@ -4099,6 +4099,61 @@ fi fi +echo "$as_me:$LINENO: checking for sched_yield support" >&5 +echo $ECHO_N "checking for sched_yield support... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +sched_yield () + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SCHED_YIELD 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + MALLOC_TYPE=S diff --git a/src/command.C b/src/command.C index 23090b7b..fbca6ea8 100644 --- a/src/command.C +++ b/src/command.C @@ -50,17 +50,16 @@ #include "version.h" #include "command.h" +#if HAVE_SCHED_YIELD +# include +#endif + #ifdef KEYSYM_RESOURCE # include "keyboard.h" #endif #include -#define HAVE_SCHED_YIELD 1 //D//TODO//FIXME -#if HAVE_SCHED_YIELD -# include -#endif - /*----------------------------------------------------------------------*/ #define IS_CONTROL(ch) !((ch) & 0xffffff60UL) -- 2.34.1