def __init__(self, py_db): PyDBDaemonThread.__init__(self, py_db) self._event = threading.Event() self._handles = [] # We could probably do things valid without this lock so that it's possible to add # handles while processing, but the implementation would also be harder to follow, # so, for now, we're either processing or adding handles, not both at the same time. self._lock = threading.Lock()
def __init__(self, func_name, condition, expression, suspend_policy="NONE", hit_condition=None, is_logpoint=False): self.condition = condition self.func_name = func_name self.expression = expression self.suspend_policy = suspend_policy self.hit_condition = hit_condition self._hit_count = 0 self._hit_condition_lock = threading.Lock() self.is_logpoint = is_logpoint
def ForkSafeLock(rlock=False): if rlock: return threading.RLock() else: return threading.Lock()
def __init__(self, py_db): self._thread = None self._lock = threading.Lock() self._py_db = weakref.ref(py_db)