summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:49:57 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 10:49:57 +0000
commit7ea35afa1dc69c240202ef7b10f8f7c7f39807c1 (patch)
tree1178ba836134eff680e9a5eaca346ae2d57b840b
parente86c91414055573dc914c83ab0725f43926f478f (diff)
merge revision(s) 15546:
* ext/readline/readline.c (readline_event): prevent polling. based on a patch from error errorsson in [ruby-Bugs-17675]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/readline/readline.c19
-rw-r--r--version.h2
3 files changed, 23 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e04d91..88337b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jun 15 19:49:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/readline/readline.c (readline_event): prevent polling. based on
+ a patch from error errorsson in [ruby-Bugs-17675].
+
Sun Jun 15 19:24:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 4f840ee..3625fad 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -38,17 +38,32 @@ static ID completion_proc, completion_case_fold;
# define rl_completion_matches completion_matches
#endif
-static int readline_event(void);
static char **readline_attempted_completion_function(const char *text,
int start, int end);
+#ifdef HAVE_RL_EVENT_HOOK
+#ifdef DOSISH
+#define BUSY_WAIT 1
+#else
+#define BUSY_WAIT 0
+#endif
+
+static int readline_event(void);
static int
readline_event()
{
- CHECK_INTS;
+#if BUSY_WAIT
rb_thread_schedule();
+#else
+ fd_set rset;
+
+ FD_ZERO(&rset);
+ FD_SET(fileno(rl_instream), &rset);
+ rb_thread_select(fileno(rl_instream) + 1, &rset, NULL, NULL, NULL);
return 0;
+#endif
}
+#endif
static VALUE
readline_readline(argc, argv, self)
diff --git a/version.h b/version.h
index 3656451..3bd6faf 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 180
+#define RUBY_PATCHLEVEL 181
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8