Skip to content

Commit

Permalink
Use Lock from utils, rather than threading to ease future debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Jun 15, 2016
1 parent e9c4ca4 commit 44eac70
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ZODB/mvccadapter.py
Expand Up @@ -6,12 +6,10 @@
to treat Relstoage and other storages in pretty much the same way and
also simplifies the implementation of the DB and Connection classes.
"""
import threading

import zope.interface

from . import interfaces, serialize, POSException
from .utils import p64, u64
from .utils import p64, u64, Lock

class Base(object):

Expand Down Expand Up @@ -61,7 +59,7 @@ class MVCCAdapter(Base):
def __init__(self, storage):
Base.__init__(self, storage)
self._instances = set()
self._lock = threading.Lock()
self._lock = Lock()
if hasattr(storage, 'registerDB'):
storage.registerDB(self)

Expand Down Expand Up @@ -121,7 +119,7 @@ class MVCCAdapterInstance(Base):
def __init__(self, base):
self._base = base
Base.__init__(self, base._storage)
self._lock = threading.Lock()
self._lock = Lock()
self._invalidations = set()
self._start = None # Transaction start time
self._sync = getattr(self._storage, 'sync', lambda : None)
Expand Down

0 comments on commit 44eac70

Please sign in to comment.