summaryrefslogtreecommitdiff
path: root/ext/pty/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pty/pty.c')
-rw-r--r--ext/pty/pty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 3189b9ae65..cea0de50a2 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -300,6 +300,7 @@ pty_finalize_syswait(info)
struct pty_info *info;
{
rb_thread_kill(info->thread);
+ rb_funcall(info->thread, rb_intern("value"), 0);
rb_detach_process(info->child_pid);
return Qnil;
}
@@ -438,9 +439,9 @@ pty_getpty(argc, argv, self)
thinfo.thread = rb_thread_create(pty_syswait, (void*)&info);
thinfo.child_pid = info.child_pid;
+ rb_thread_schedule();
if (rb_block_given_p()) {
-
rb_ensure(rb_yield, res, pty_finalize_syswait, (VALUE)&thinfo);
return Qnil;
}