[前][次][番号順一覧][スレッド一覧]

ruby-changes:38176

From: akr <ko1@a...>
Date: Sun, 12 Apr 2015 14:51:18 +0900 (JST)
Subject: [ruby-changes:38176] akr:r50257 (trunk): * test/ruby/test_io.rb: New test that open(fifo) doesn't block other

akr	2015-04-12 13:55:46 +0900 (Sun, 12 Apr 2015)

  New Revision: 50257

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50257

  Log:
    * test/ruby/test_io.rb: New test that open(fifo) doesn't block other
      threads.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50256)
+++ ChangeLog	(revision 50257)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Apr 12 13:54:05 2015  Tanaka Akira  <akr@f...>
+
+	* test/ruby/test_io.rb: New test that open(fifo) doesn't block other
+	  threads.
+
 Sun Apr 12 13:52:18 2015  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* ext/coverage/coverage.c: Remove extension from require argument.
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 50256)
+++ test/ruby/test_io.rb	(revision 50257)
@@ -3178,4 +3178,18 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3178
     assert_raise(IOError) { io.close }
   end
 
+  def test_open_fifo_does_not_block_other_threads
+    mkcdtmpdir {
+      assert(system("mkfifo", "fifo"), "mkfifo fails")
+      assert_separately([], <<-'EOS')
+        t = Thread.new {
+          open("fifo") {}
+        }
+        sleep 0.1 until t.status == "sleep"
+        sleep 0.1
+        assert(true)
+      EOS
+    }
+  end if /mswin|mingw|bccwin/ !~ RUBY_PLATFORM
+
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]