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

ruby-changes:29851

From: naruse <ko1@a...>
Date: Thu, 11 Jul 2013 00:36:20 +0900 (JST)
Subject: [ruby-changes:29851] naruse:r41903 (trunk): On FreeBSD, threads don't die on daemon(3)

naruse	2013-07-11 00:36:06 +0900 (Thu, 11 Jul 2013)

  New Revision: 41903

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

  Log:
    On FreeBSD, threads don't die on daemon(3)

  Modified files:
    trunk/test/ruby/test_process.rb

Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 41902)
+++ test/ruby/test_process.rb	(revision 41903)
@@ -1492,7 +1492,19 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1492
         assert_equal(2, data.size, bug4920)
         assert_not_include(data.map(&:to_i), pid)
       end
-    else
+    elsif /freebsd/ =~ RUBY_PLATFORM
+      def test_daemon_no_threads
+        data = Timeout.timeout(3) do
+          IO.popen("-") do |f|
+            break f.readlines.map(&:chomp) if f
+            th = Thread.start {sleep 3}
+            Process.daemon(true, true)
+            puts Thread.list.size, th.status.inspect
+          end
+        end
+        assert_equal(["2", "\"run\""], data)
+      end
+    else # darwin
       def test_daemon_no_threads
         data = Timeout.timeout(3) do
           IO.popen("-") do |f|

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

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