Skip to main content

Module session_lock

Module session_lock 

Source
Expand description

Per-session journal ownership lock.

Whoever holds a Runtime for session X holds an exclusive advisory flock on <sessions_dir>/<id>.lock. Two runtimes for the same journal are never allowed — the second caller gets an actionable error pointing at the holder’s pid.

The lock is released on drop (or when the process dies — flock semantics). Stale lock files from dead processes never block.

Structs§

LockHolder
Body written into the lock file so the error message can name the holder.
SessionLock
Held for the runtime’s lifetime; dropping releases the flock.

Enums§

SessionLockError

Functions§

lock_path
Lock-file path for a session (for cleanup).
sessions_dir
The sessions directory (delegates to config).