Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 8 additions and 8 deletions.
  1. +8 −8 verhogen.rb
View
16 verhogen.rb
@@ -48,10 +48,14 @@ def acquire(timeout = 0)
end
def release
- if holding_lock?
- client.lpush(list_key, 1)
- @holding_lock = false
- end
+ return false unless holding_lock?
+ client.lpush(list_key, 1)
+ @holding_lock = false
+ true
+ end
+
+ def holding_lock?
+ @holding_lock
end
@@ -73,10 +77,6 @@ def create_if_necessary
client.lpush(list_key, 1)
end
end
-
- def holding_lock?
- @holding_lock
- end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.