Ejemplo n.º 1
0
 def blocker_agent():
     try:
         trylock_exclusive(lockdir, blocking_key)
         time.sleep(0.5)
         unlock(lockdir, blocking_key)
     finally:
         sys.exit(0)
Ejemplo n.º 2
0
 def blocker_agent():
     try:
         trylock_exclusive(lockdir, blocking_key)
         time.sleep(0.5)
         unlock(lockdir, blocking_key)
     finally:
         sys.exit(0)
Ejemplo n.º 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
    )
Ejemplo n.º 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
    )
Ejemplo n.º 5
0
def unlock_uuid(testdir):
    return dirlock.unlock(testdir, prefix.paths.uuid())