def __init__(self, status, startPoint): self.status = AtomicInteger(status) self.startPoint = startPoint self.lock = Lock() # Faking java's CountdownLatch w/ a simple event---it's only from 1 self.latch = Event()
def __init__(self, state, meta=None): super(Ref, self).__init__(meta) self._id = refids.next() self._faults = AtomicInteger(0) self._tinfo = None self._maxHistory = 10 self._minHistory = 0 # NOTE SharedLock is also re-entrant. self._lock = SharedLock(None, False) self._tvals = TVal(state, 0, time() * 1000)
class Info: def __init__(self, status, startPoint): self.status = AtomicInteger(status) self.startPoint = startPoint self.lock = Lock() # Faking java's CountdownLatch w/ a simple event---it's only from 1 self.latch = Event() def running(self): status = self.status.get() return status in (TransactionState.Running, TransactionState.Committing)