Esempio n. 1
0
 def LockActionsThreadProc(cls):
     lock = threading.Lock()
     for _ in range(1000):
         _fork_locking.acquire_lock()
         try:
             with lock:
                 time.sleep(0.001)
                 logging.debug("lock action done")
             with cls.LockActionsGuard:
                 cls.LockActionsCounter += 1
         finally:
             _fork_locking.release_lock()
         time.sleep(0.001)
Esempio n. 2
0
def acquire_restore_lock(lock, count_owner):
    _fork_locking.acquire_lock()
    return lock._acquire_restore(count_owner)
Esempio n. 3
0
def acquire_restore_lock(lock, count_owner):
    _fork_locking.acquire_lock()
    return lock._acquire_restore(count_owner)
Esempio n. 4
0
def acquire_lock(lock, blocking=True):
    if not blocking:
        raise RuntimeError("Non-blocking acquire not implemented")
    _fork_locking.acquire_lock()
    return lock.acquire()
Esempio n. 5
0
def acquire_lock(lock, blocking=True):
    if not blocking:
        raise RuntimeError("Non-blocking acquire not implemented")
    _fork_locking.acquire_lock()
    return lock.acquire()