Feature #5097 » ruby193.diff
bootstraptest/test_thread.rb Thu Jul 28 12:49:25 2011 | ||
---|---|---|
}
|
||
assert_equal %q{100}, %q{
|
||
100.times{
|
||
Thread.new{loop{Thread.pass}}
|
||
Thread.new{Thread.pass while true}
|
||
}
|
||
}
|
||
assert_equal %q{ok}, %q{
|
ext/socket/lib/socket.rb Fri Jul 29 10:50:44 2011 | ||
---|---|---|
end
|
||
end
|
||
pktinfo_sockets = {}
|
||
sockets.each {|s|
|
||
ai = s.local_address
|
||
if ipv6_recvpktinfo && ai.ipv6? && ai.ip_address == "::"
|
||
s.setsockopt(:IPV6, ipv6_recvpktinfo, 1)
|
||
pktinfo_sockets[s] = true
|
||
end
|
||
}
|
||
... | ... | |
if ai.ipv6? and pktinfo = controls.find {|c| c.cmsg_is?(:IPV6, :PKTINFO) }
|
||
ai = Addrinfo.udp(pktinfo.ipv6_pktinfo_addr.ip_address, ai.ip_port)
|
||
yield msg, UDPSource.new(sender_addrinfo, ai) {|reply_msg|
|
||
r.sendmsg reply_msg, 0, sender_addrinfo, pktinfo
|
||
r.sendmsg reply_msg, 0, sender_addrinfo
|
||
}
|
||
else
|
||
yield msg, UDPSource.new(sender_addrinfo, ai) {|reply_msg|
|
lib/test/unit.rb Wed Jul 27 16:04:54 2011 | ||
---|---|---|
end
|
||
end
|
||
end
|
||
@workers.each do |worker|
|
||
begin
|
||
timeout(1) do
|
||
worker.puts "quit"
|
||
if @workers
|
||
@workers.each do |worker|
|
||
begin
|
||
timeout(1) do
|
||
worker.puts "quit"
|
||
end
|
||
rescue Errno::EPIPE
|
||
rescue Timeout::Error
|
||
end
|
||
rescue Errno::EPIPE
|
||
rescue Timeout::Error
|
||
worker.close
|
||
end
|
||
worker.close
|
||
end
|
||
begin
|
||
timeout(0.2*@workers.size) do
|
||
Process.waitall
|
||
if @workers
|
||
timeout(0.2*@workers.size) do
|
||
Process.waitall
|
||
end
|
||
end
|
||
rescue Timeout::Error
|
||
@workers.each do |worker|
|