@@ -815,18 +815,17 @@ impl File {
815815
816816 /// Acquire an exclusive lock on the file. Blocks until the lock can be acquired.
817817 ///
818- /// This acquires an exclusive lock; no other file handle to this file, in this or any other
818+ /// This acquires an exclusive lock. No * other* file handle to this file, in this or any other
819819 /// process, may acquire another lock.
820+ /// If this file handle/descriptor, or a clone of it, already holds a lock, the exact behavior
821+ /// is unspecified and platform dependent, including the possibility that it will deadlock.
822+ /// However, if this method returns, then an exclusive lock is held.
820823 ///
821824 /// This lock may be advisory or mandatory. This lock is meant to interact with [`lock`],
822825 /// [`try_lock`], [`lock_shared`], [`try_lock_shared`], and [`unlock`]. Its interactions with
823826 /// other methods, such as [`read`] and [`write`] are platform specific, and it may or may not
824827 /// cause non-lockholders to block.
825828 ///
826- /// If this file handle/descriptor, or a clone of it, already holds a lock the exact behavior
827- /// is unspecified and platform dependent, including the possibility that it will deadlock.
828- /// However, if this method returns, then an exclusive lock is held.
829- ///
830829 /// If the file is not open for writing, it is unspecified whether this function returns an error.
831830 ///
832831 /// The lock will be released when this file (along with any other file descriptors/handles
@@ -869,18 +868,18 @@ impl File {
869868
870869 /// Acquire a shared (non-exclusive) lock on the file. Blocks until the lock can be acquired.
871870 ///
872- /// This acquires a shared lock; more than one file handle, in this or any other process, may
873- /// hold a shared lock, but none may hold an exclusive lock at the same time.
871+ /// This acquires a shared lock. More than one file handle to this file, in this or any other
872+ /// process, may hold a shared lock, but no *other* file handle may hold an exclusive lock at
873+ /// the same time.
874+ /// If this file handle/descriptor, or a clone of it, already holds a lock, the exact
875+ /// behavior is unspecified and platform dependent, including the possibility that it will
876+ /// deadlock. However, if this method returns, then a shared lock is held.
874877 ///
875878 /// This lock may be advisory or mandatory. This lock is meant to interact with [`lock`],
876879 /// [`try_lock`], [`lock_shared`], [`try_lock_shared`], and [`unlock`]. Its interactions with
877880 /// other methods, such as [`read`] and [`write`] are platform specific, and it may or may not
878881 /// cause non-lockholders to block.
879882 ///
880- /// If this file handle/descriptor, or a clone of it, already holds a lock, the exact behavior
881- /// is unspecified and platform dependent, including the possibility that it will deadlock.
882- /// However, if this method returns, then a shared lock is held.
883- ///
884883 /// The lock will be released when this file (along with any other file descriptors/handles
885884 /// duplicated or inherited from it) is closed, or if the [`unlock`] method is called.
886885 ///
0 commit comments