Skip to content

Commit 7ea35af

Browse files
committed
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
1 parent e86c914 commit 7ea35af

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun Jun 15 19:49:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* ext/readline/readline.c (readline_event): prevent polling. based on
4+
a patch from error errorsson in [ruby-Bugs-17675].
5+
16
Sun Jun 15 19:24:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
27

38
* parse.y (yycompile): clear ruby_eval_tree_begin if parse failed.

ext/readline/readline.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,32 @@ static ID completion_proc, completion_case_fold;
3838
# define rl_completion_matches completion_matches
3939
#endif
4040

41-
static int readline_event(void);
4241
static char **readline_attempted_completion_function(const char *text,
4342
int start, int end);
4443

44+
#ifdef HAVE_RL_EVENT_HOOK
45+
#ifdef DOSISH
46+
#define BUSY_WAIT 1
47+
#else
48+
#define BUSY_WAIT 0
49+
#endif
50+
51+
static int readline_event(void);
4552
static int
4653
readline_event()
4754
{
48-
CHECK_INTS;
55+
#if BUSY_WAIT
4956
rb_thread_schedule();
57+
#else
58+
fd_set rset;
59+
60+
FD_ZERO(&rset);
61+
FD_SET(fileno(rl_instream), &rset);
62+
rb_thread_select(fileno(rl_instream) + 1, &rset, NULL, NULL, NULL);
5063
return 0;
64+
#endif
5165
}
66+
#endif
5267

5368
static VALUE
5469
readline_readline(argc, argv, self)

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2008-06-15"
33
#define RUBY_VERSION_CODE 185
44
#define RUBY_RELEASE_CODE 20080615
5-
#define RUBY_PATCHLEVEL 180
5+
#define RUBY_PATCHLEVEL 181
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)