Skip to main content

with_lock

Function with_lock 

Source
pub fn with_lock<T>(f: impl FnOnce() -> T) -> T
Expand description

One writer at a time among Sioul’s own writers of notes: the window and an agent (sioul mcp) each read a note again, change it and write it with this held, so that neither writes an older copy over the other’s change, and two new notes never take one name. An advisory lock (filelock) on one hidden file of Sioul’s state folder (.notes.lock), not one beside each note: the notes folder is yours, and a sync app or another editor would carry or show a lock file in each of its folders.