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