diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-30 11:46:03 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-30 11:46:03 +0000 |
commit | 1bd12d78c79c1194363f7755acab0a31109b935a (patch) | |
tree | 47987bcdbca56b2e8f1669e304e215d2d927e04b /test | |
parent | edd9ca9cd2760fd50ca9a51477b36e887510f476 (diff) |
merge revision(s) 40534,41886,41903,41910: [Backport #8616]
process.c: rb_daemon should not raise
* process.c (rb_daemon): should not raise exceptions, since
proc_daemon() will deal with errors.
* process.c (fork_daemon): kill the other threads all and abandon the
kept mutexes.
* process.c (fork_daemon): kill the other threads all and abandon the
kept mutexes.
* process.c (rb_daemon): daemon(3) is implemented with fork(2).
Therefore it needs rb_thread_atfork(). (and revert r41903)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index d1e2e1984d..83ff379ca9 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1319,6 +1319,18 @@ class TestProcess < Test::Unit::TestCase assert_equal(2, data.size, bug4920) assert_not_include(data.map(&:to_i), pid) end + else # darwin + 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(["1", "false"], data) + end end end |