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