On this page
Advisory file lock using fcntl.flock to prevent concurrent rlsbl operations from mutating project state in both regular and monorepo modes.
#rlsbl.lock
#rlsbl.lock
Advisory file lock using fcntl.flock to prevent concurrent rlsbl operations from mutating project state in both regular and monorepo modes.
#acquire_lock
def acquire_lock(lock_dir='.rlsbl', *, project_root)Acquire an exclusive advisory lock on
If another process holds the lock, prints a waiting message and blocks until the lock is available. Returns early if already locked (prevents fd leak on double-acquire).
lock_dir: directory for the lock file (default ".rlsbl"). In monorepo mode pass ".rlsbl-monorepo". project_root: when provided, lock_dir is resolved relative to it.
#release_lock
def release_lock()Release the advisory lock, close the file descriptor, and remove the lock file.
#is_stale
def is_stale(lock_path=None, *, project_root)Check if a lock file exists but no process holds it.
Returns True if the file exists and is not held (stale). Returns False if the file doesn't exist or is actively held.
project_root: when lock_path is None, build the default lock path relative to project_root.
#rlsbl_lock
def rlsbl_lock(lock_dir='.rlsbl', *, project_root)Context manager that acquires the lock on enter and releases on exit.