summaryrefslogtreecommitdiff
path: root/sample/philos.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/philos.rb')
-rw-r--r--sample/philos.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/sample/philos.rb b/sample/philos.rb
index ee0a8cd..3ccb052 100644
--- a/sample/philos.rb
+++ b/sample/philos.rb
@@ -30,7 +30,7 @@ def philosopher(n)
$forks[n].lock
if not $forks[(n+1)%N].try_lock
$forks[n].unlock # avoid deadlock
- continue
+ next
end
$state[n*2] = ?|;
$state[(n+1)%N*2] = ?|;