Runs fn while holding the exclusive write lock for filePath, releasing it afterwards even on error. Use this to make a whole read-modify-write sequence atomic across processes (preventing lost updates), not just the final write.
fn
filePath
Runs
fnwhile holding the exclusive write lock forfilePath, releasing it afterwards even on error. Use this to make a whole read-modify-write sequence atomic across processes (preventing lost updates), not just the final write.