mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/trunk@41910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f328b9d0d5
commit
300b7c80e4
3 changed files with 6 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Jul 11 10:09:18 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* process.c (rb_daemon): daemon(3) is implemented with fork(2).
|
||||||
|
Therefore it needs rb_thread_atfork(). (and revert r41903)
|
||||||
|
|
||||||
Thu Jul 11 03:22:10 2013 Aaron Patterson <aaron@tenderlovemaking.com>
|
Thu Jul 11 03:22:10 2013 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* tool/probes_to_wiki.rb: adding a script to convert probes.d to wiki
|
* tool/probes_to_wiki.rb: adding a script to convert probes.d to wiki
|
||||||
|
|
|
@ -5736,6 +5736,7 @@ rb_daemon(int nochdir, int noclose)
|
||||||
before_fork();
|
before_fork();
|
||||||
err = daemon(nochdir, noclose);
|
err = daemon(nochdir, noclose);
|
||||||
after_fork();
|
after_fork();
|
||||||
|
rb_thread_atfork();
|
||||||
#else
|
#else
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
|
|
@ -1492,18 +1492,6 @@ class TestProcess < Test::Unit::TestCase
|
||||||
assert_equal(2, data.size, bug4920)
|
assert_equal(2, data.size, bug4920)
|
||||||
assert_not_include(data.map(&:to_i), pid)
|
assert_not_include(data.map(&:to_i), pid)
|
||||||
end
|
end
|
||||||
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
|
else # darwin
|
||||||
def test_daemon_no_threads
|
def test_daemon_no_threads
|
||||||
data = Timeout.timeout(3) do
|
data = Timeout.timeout(3) do
|
||||||
|
|
Loading…
Add table
Reference in a new issue