Пример #1
0
 def blocker_agent():
     try:
         trylock_exclusive(lockdir, blocking_key)
         time.sleep(0.5)
         unlock(lockdir, blocking_key)
     finally:
         sys.exit(0)
Пример #2
0
 def blocker_agent():
     try:
         trylock_exclusive(lockdir, blocking_key)
         time.sleep(0.5)
         unlock(lockdir, blocking_key)
     finally:
         sys.exit(0)
Пример #3
0
def test_lock_twice_with_unlock(lock_dir_path, key_path, lock_type):
    exclusive = LOCK_TYPES[lock_type]
    assert dirlock.trylock(
        path=lock_dir_path, excl=exclusive, key_path=key_path
    )
    unlock(lock_dir_path, key_path)
    assert dirlock.trylock(
        path=lock_dir_path, excl=exclusive, key_path=key_path
    )
Пример #4
0
def test_lock_twice_with_unlock(lock_dir_path, key_path, lock_type):
    exclusive = LOCK_TYPES[lock_type]
    assert dirlock.trylock(
        path=lock_dir_path,
        excl=exclusive, key_path=key_path
    )
    unlock(lock_dir_path, key_path)
    assert dirlock.trylock(
        path=lock_dir_path,
        excl=exclusive, key_path=key_path
    )
Пример #5
0
def unlock_uuid(testdir):
    return dirlock.unlock(testdir, prefix.paths.uuid())