Project

General

Profile

Bug #236 » bug.rb

radarek (Radosław Bułat), 07/09/2008 03:36 AM

 
1
$queue = []
2

    
3
def produce
4
  $queue << true if rand(10) < 5
5
end
6

    
7
loop do
8
  produce
9
  while client = $queue.shift do
10
    Thread.new(client) do |c|
11
      raise "bug" if c == false
12
    end
13
    puts Thread.list.size
14
  end
15
end
16