14 Apr
2011
14 Apr
'11
2:51 p.m.
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 0b6adfbe2584f7a43d9302b312e751f2e9505b04 https://github.com/MacRuby/MacRuby/commit/0b6adfbe2584f7a43d9302b312e751f2e9... Author: Kouji Takao <kouji@takao7.net> Date: 2011-04-14 (Thu, 14 Apr 2011) Changed paths: M test_vm/gcd.rb Log Message: ----------- set timeout, because block code in Dispatch::Queue#sync. see below. --- @n = 0 q = Dispatch::Queue.new('foo') g = Dispatch::Group.new 10000.times do |i| Dispatch::Queue.concurrent.async(g) do q.sync { @n += i } # <= block here end end g.wait(10) p @n