/** * Advisory File Lock (GIT-24) * * Uses O_CREAT | O_EXCL for atomic lock file creation — the standard * POSIX advisory lock pattern. Zero dependencies. * * Lock file: .gitmem/active-sessions.lock * * Stale lock detection: if a lock file is older than STALE_THRESHOLD_MS, * the holder likely crashed. We break the stale lock and retry. */ /** * Acquire an advisory file lock synchronously. * * Uses O_CREAT | O_EXCL to atomically create the lock file. * Retries with sleep until timeout. Breaks stale locks. * * @throws Error if lock cannot be acquired within timeout */ export declare function acquireLockSync(lockPath: string, timeoutMs?: number, retryMs?: number): void; /** * Release an advisory file lock synchronously. * Ignores ENOENT (lock already released). */ export declare function releaseLockSync(lockPath: string): void; /** * Execute a function while holding an advisory file lock. * Guarantees lock release even if fn throws. */ export declare function withLockSync(lockPath: string, fn: () => T): T; //# sourceMappingURL=file-lock.d.ts.map