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')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".
#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)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.
#rlsbl_lock
def rlsbl_lock(lock_dir='.rlsbl')Context manager that acquires the lock on enter and releases on exit.