File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,14 @@ impl UnitLock {
114114
115115 // TODO: Add debug asserts to verify the lock state?
116116
117- // We know we have an exclusive lock here so we should never block.
118- // This is not super well documented but `lock_shared()` should downgrade the lock.
117+ // NOTE:
118+ // > Subsequent flock() calls on an already locked file will convert an existing lock to the new lock mode.
119+ // https://man7.org/linux/man-pages/man2/flock.2.html
120+ //
121+ // However, the `std::file::File::lock/lock_shared` is allowed to change this in the
122+ // future. So its probably up to us if we are okay with using this or if we want to use a
123+ // different interace to flock.
124+ //
119125 // TODO: Need to validate on other platforms...
120126 gaurd. primary . lock_shared ( ) . unwrap ( ) ;
121127 }
You can’t perform that action at this time.
0 commit comments