saws #5226(2008/01/08 10:49 GMT) [ Ruby ] Rating-1/1=-1.00
1 2 3 4 5 6 7 8 9 10 11 12
puts 'Starting: main thread' n = 4 Array.new(n){|i| Thread.new(i){|j| Thread.stop puts "Starting: #{j+1}th thread." sleep rand(10)+5 puts "Ended: #{j+1}th thread." } }.each{|t| t.wakeup} sleep 1 while Thread.list.size > 1 puts 'Ended: main thread.'
Rating-1/1=-1.00-0+
[ reply ]
saws
#5226()
[
Ruby
]
Rating-1/1=-1.00
Rating-1/1=-1.00-0+
[ reply ]