SIGN IN SIGN UP

fix: use cross-platform filelock instead of POSIX-only fcntl (#53)

fcntl is unavailable on Windows, so _LockedFileStore crashed on import
there. Switch to the filelock library's ReadWriteLock, preserving the
LOCK_SH/LOCK_EX distinction (shared reads via read_lock, exclusive writes
via write_lock).

Construct the lock with is_singleton=False so two StateStore instances for
the same path in one process don't collapse into a single reentrant lock,
whose reentrancy guard would otherwise raise RuntimeError under
multi-threaded write contention.

Add regression tests for cross-process exclusion, concurrent readers, and
multi-thread writes, and document the locking design in
docs/01_session_management.md.
T
Tyler committed
65a3d0248b540dffbbe2aa6638e886dfb7e7d385
Parent: 0d172dc
Committed by GitHub <noreply@github.com> on 6/10/2026, 7:07:48 PM