[macruby-changes] [MacRuby/MacRuby] 0b6adf: set timeout, because block code in Dispatch::Queue...

noreply at github.com noreply at github.com
Thu Apr 14 07:51:20 PDT 2011


Branch: refs/heads/master
Home:   https://github.com/MacRuby/MacRuby

Commit: 0b6adfbe2584f7a43d9302b312e751f2e9505b04
    https://github.com/MacRuby/MacRuby/commit/0b6adfbe2584f7a43d9302b312e751f2e9505b04
Author: Kouji Takao <kouji at 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




More information about the macruby-changes mailing list