Skip to content

Instantly share code, notes, and snippets.

@diegoeche
Created November 14, 2013 15:28
Show Gist options
  • Save diegoeche/7468756 to your computer and use it in GitHub Desktop.
Save diegoeche/7468756 to your computer and use it in GitHub Desktop.
lock = RedisLock.new(:client => $stats_wolverine,
:name => "My Lock",
:timeout => 10)
shared_var = 1
lock.atomically {
shared_var += 1
lock.atomically {
shared_var += 1 # This one fails
}
}
assert_equal 2, shared_var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment