summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-09 16:33:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-09 16:33:02 +0000
commitce28a7539d28fb9c2fa77b0df51c4d35165442ce (patch)
treeff95e2993d191741dd44042be196b1a2a4e68bb3 /test/ruby/test_process.rb
parent6cf4e97b3ede0d34511e2a7b70ca611a526dc554 (diff)
* process.c: Release GVL when opening a file in spawn() to avoid whole
process blocking when opening a named pipe. (open_func): New function. (rb_execarg_parent_start1): Extracted from rb_execarg_parent_start and use rb_thread_call_without_gvl2 to release GVL when opening a file. (rb_execarg_parent_start): Invoke rb_execarg_parent_start1 via rb_protect and invoke rb_execarg_parent_end when error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 8ecaf304f6..c7f85bd9b2 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -558,6 +558,22 @@ class TestProcess < Test::Unit::TestCase
}
end unless windows? # passing non-stdio fds is not supported on Windows
+ def test_execopts_redirect_open_fifo
+ with_tmpchdir {|d|
+ system("mknod fifo p")
+ return if !$?.success?
+ assert(FileTest.pipe?("fifo"))
+ t1 = Thread.new {
+ system(*ECHO["output to fifo"], :out=>"fifo")
+ }
+ t2 = Thread.new {
+ IO.popen([*CAT, :in=>"fifo"]) {|f| f.read }
+ }
+ v1, v2 = assert_join_threads([t1, t2])
+ assert_equal("output to fifo\n", v2)
+ }
+ end
+
def test_execopts_redirect_pipe
with_pipe {|r1, w1|
with_pipe {|r2, w2|