summaryrefslogtreecommitdiff
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
commit6f36fedaa4788cfa956764d5b7e63fc67b444400 (patch)
treed8f62d18399c511f1626f841e8dbb95466f7558c /sample/philos.rb
parent25aa3816b173efa6889f2832c34da13021f656eb (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/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 3ccb052..119e7c3 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