Commit b561c753 authored by Jeremy Hylton's avatar Jeremy Hylton

Fix one locking glitch, add comment about the other.

parent 0f5bd5da
...@@ -587,6 +587,7 @@ class ClientStorage(object): ...@@ -587,6 +587,7 @@ class ClientStorage(object):
self._pickler.fast = 1 # Don't use the memo self._pickler.fast = 1 # Don't use the memo
# XXX should batch these operations for efficiency # XXX should batch these operations for efficiency
# XXX need to acquire lock...
for oid, tid, version in self._cache.contents(): for oid, tid, version in self._cache.contents():
server.verify(oid, version, tid) server.verify(oid, version, tid)
self._pending_server = server self._pending_server = server
...@@ -1098,7 +1099,11 @@ class ClientStorage(object): ...@@ -1098,7 +1099,11 @@ class ClientStorage(object):
def invalidateTransaction(self, tid, args): def invalidateTransaction(self, tid, args):
"""Invalidate objects modified by tid.""" """Invalidate objects modified by tid."""
self._cache.setLastTid(tid) self._lock.acquire()
try:
self._cache.setLastTid(tid)
finally:
self._lock.release()
if self._pickler is not None: if self._pickler is not None:
log2(BLATHER, log2(BLATHER,
"Transactional invalidation during cache verification") "Transactional invalidation during cache verification")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment