Skip to content

Commit

Permalink
We have the lock if refcount is greater than 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanzhu Du committed Jul 25, 2011
1 parent 1189ed0 commit 3a21321
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongo/locking/model_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def have_lock?
lockable = self.class.locker.root_for(self)
locker = lockable.class.locker
key = locker.key_for(lockable)
return locker.refcounts[key] == 0
return locker.refcounts[key] > 0
end

end # InstanceMethods
Expand Down

0 comments on commit 3a21321

Please sign in to comment.