Permalink
Browse files

Do not hold lock when registering iterators

Dictionary assignment does not need external synchronisation (and the
used WeakValueDictionary delegates assignment to a regular dict).
  • Loading branch information...
wbolster committed Nov 26, 2012
1 parent 763f7f0 commit b281f690f740a92913d5b6be559b8581b1cb2d30
Showing with 1 addition and 2 deletions.
  1. +1 −2 plyvel/_plyvel.pyx
View
@@ -349,8 +349,7 @@ cdef class DB:
cdef _register_iterator(self, Iterator iterator):
# Store a weak reference to an iterator (needed when closing DB)
- with self.lock:
- self.iterators[id(iterator)] = iterator
+ self.iterators[id(iterator)] = iterator
def snapshot(self):
return Snapshot(db=self)

0 comments on commit b281f69

Please sign in to comment.