summaryrefslogtreecommitdiffstats
path: root/sample/philos.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-27 09:11:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-27 09:11:13 +0000
commit8b6e94a60e0db6625a6642ae0460165d5736db11 (patch)
treed8f62d18399c511f1626f841e8dbb95466f7558c /sample/philos.rb
parenta2aa5597e72592d2fadf3847ffed4298e964352c (diff)
downloadruby-8b6e94a60e0db6625a6642ae0460165d5736db11.tar.gz
ruby-8b6e94a60e0db6625a6642ae0460165d5736db11.tar.xz
ruby-8b6e94a60e0db6625a6642ae0460165d5736db11.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/philos.rb')
-rw-r--r--sample/philos.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/philos.rb b/sample/philos.rb
index 3ccb05253..119e7c36b 100644
--- a/sample/philos.rb
+++ b/sample/philos.rb
@@ -46,8 +46,8 @@ def philosopher(n)
end
end
-for i in 0..N-1
- Thread.start{philosopher(i)}
+for n in 0..N-1
+ Thread.start(n){|i| philosopher(i)}
sleep 0.1
end