@@ -624,20 +624,20 @@ impl File {
624
624
self . inner . datasync ( )
625
625
}
626
626
627
- /// Acquire an exclusive advisory lock on the file. Blocks until the lock can be acquired.
627
+ /// Acquire an exclusive lock on the file. Blocks until the lock can be acquired.
628
628
///
629
- /// This acquires an exclusive advisory lock; no other file handle to this file may acquire
630
- /// another lock.
629
+ /// This acquires an exclusive lock; no other file handle to this file may acquire another lock.
631
630
///
632
- /// If this file handle/descriptor, or a clone of it, already holds an advisory lock the exact
633
- /// behavior is unspecified and platform dependent, including the possibility that it will
634
- /// deadlock. However, if this method returns, then an exclusive lock is held.
631
+ /// If this file handle/descriptor, or a clone of it, already holds an lock the exact behavior
632
+ /// is unspecified and platform dependent, including the possibility that it will deadlock.
633
+ /// However, if this method returns, then an exclusive lock is held.
635
634
///
636
635
/// If the file not open for writing, it is unspecified whether this function returns an error.
637
636
///
638
- /// Note, this is an advisory lock meant to interact with [`lock_shared`], [`try_lock`],
639
- /// [`try_lock_shared`], and [`unlock`]. Its interactions with other methods, such as [`read`]
640
- /// and [`write`] are platform specific, and it may or may not cause non-lockholders to block.
637
+ /// This lock may be advisory or mandatory. This lock is meant to interact with [`lock`],
638
+ /// [`try_lock`], [`lock_shared`], [`try_lock_shared`], and [`unlock`]. Its interactions with
639
+ /// other methods, such as [`read`] and [`write`] are platform specific, and it may or may not
640
+ /// cause non-lockholders to block.
641
641
///
642
642
/// The lock will be released when this file (along with any other file descriptors/handles
643
643
/// duplicated or inherited from it) is closed, or if the [`unlock`] method is called.
@@ -650,6 +650,7 @@ impl File {
650
650
///
651
651
/// [changes]: io#platform-specific-behavior
652
652
///
653
+ /// [`lock`]: File::lock
653
654
/// [`lock_shared`]: File::lock_shared
654
655
/// [`try_lock`]: File::try_lock
655
656
/// [`try_lock_shared`]: File::try_lock_shared
@@ -674,18 +675,19 @@ impl File {
674
675
self . inner . lock ( )
675
676
}
676
677
677
- /// Acquire a shared (non-exclusive) advisory lock on the file. Blocks until the lock can be acquired.
678
+ /// Acquire a shared (non-exclusive) lock on the file. Blocks until the lock can be acquired.
678
679
///
679
- /// This acquires a shared advisory lock; more than one file handle may hold a shared lock, but
680
- /// none may hold an exclusive lock at the same time.
680
+ /// This acquires a shared lock; more than one file handle may hold a shared lock, but none may
681
+ /// hold an exclusive lock at the same time.
681
682
///
682
- /// If this file handle/descriptor, or a clone of it, already holds an advisory lock, the exact
683
- /// behavior is unspecified and platform dependent, including the possibility that it will
684
- /// deadlock. However, if this method returns, then a shared lock is held.
683
+ /// If this file handle/descriptor, or a clone of it, already holds an lock, the exact behavior
684
+ /// is unspecified and platform dependent, including the possibility that it will deadlock.
685
+ /// However, if this method returns, then a shared lock is held.
685
686
///
686
- /// Note, this is an advisory lock meant to interact with [`lock`], [`try_lock`],
687
- /// [`try_lock_shared`], and [`unlock`]. Its interactions with other methods, such as [`read`]
688
- /// and [`write`] are platform specific, and it may or may not cause non-lockholders to block.
687
+ /// This lock may be advisory or mandatory. This lock is meant to interact with [`lock`],
688
+ /// [`try_lock`], [`lock_shared`], [`try_lock_shared`], and [`unlock`]. Its interactions with
689
+ /// other methods, such as [`read`] and [`write`] are platform specific, and it may or may not
690
+ /// cause non-lockholders to block.
689
691
///
690
692
/// The lock will be released when this file (along with any other file descriptors/handles
691
693
/// duplicated or inherited from it) is closed, or if the [`unlock`] method is called.
@@ -699,6 +701,7 @@ impl File {
699
701
/// [changes]: io#platform-specific-behavior
700
702
///
701
703
/// [`lock`]: File::lock
704
+ /// [`lock_shared`]: File::lock_shared
702
705
/// [`try_lock`]: File::try_lock
703
706
/// [`try_lock_shared`]: File::try_lock_shared
704
707
/// [`unlock`]: File::unlock
@@ -722,24 +725,23 @@ impl File {
722
725
self . inner . lock_shared ( )
723
726
}
724
727
725
- /// Try to acquire an exclusive advisory lock on the file.
728
+ /// Try to acquire an exclusive lock on the file.
726
729
///
727
730
/// Returns `Ok(false)` if a different lock is already held on this file (via another
728
731
/// handle/descriptor).
729
732
///
730
- /// This acquires an exclusive advisory lock; no other file handle to this file may acquire
731
- /// another lock.
733
+ /// This acquires an exclusive lock; no other file handle to this file may acquire another lock.
732
734
///
733
- /// If this file handle/descriptor, or a clone of it, already holds an advisory lock, the exact
734
- /// behavior is unspecified and platform dependent, including the possibility that it will
735
- /// deadlock. However, if this method returns `Ok(true)`, then it has acquired an exclusive
736
- /// lock.
735
+ /// If this file handle/descriptor, or a clone of it, already holds an lock, the exact behavior
736
+ /// is unspecified and platform dependent, including the possibility that it will deadlock.
737
+ /// However, if this method returns `Ok(true)`, then it has acquired an exclusive lock.
737
738
///
738
739
/// If the file not open for writing, it is unspecified whether this function returns an error.
739
740
///
740
- /// Note, this is an advisory lock meant to interact with [`lock`], [`lock_shared`],
741
- /// [`try_lock_shared`], and [`unlock`]. Its interactions with other methods, such as [`read`]
742
- /// and [`write`] are platform specific, and it may or may not cause non-lockholders to block.
741
+ /// This lock may be advisory or mandatory. This lock is meant to interact with [`lock`],
742
+ /// [`try_lock`], [`lock_shared`], [`try_lock_shared`], and [`unlock`]. Its interactions with
743
+ /// other methods, such as [`read`] and [`write`] are platform specific, and it may or may not
744
+ /// cause non-lockholders to block.
743
745
///
744
746
/// The lock will be released when this file (along with any other file descriptors/handles
745
747
/// duplicated or inherited from it) is closed, or if the [`unlock`] method is called.
@@ -755,6 +757,7 @@ impl File {
755
757
///
756
758
/// [`lock`]: File::lock
757
759
/// [`lock_shared`]: File::lock_shared
760
+ /// [`try_lock`]: File::try_lock
758
761
/// [`try_lock_shared`]: File::try_lock_shared
759
762
/// [`unlock`]: File::unlock
760
763
/// [`read`]: Read::read
@@ -777,21 +780,22 @@ impl File {
777
780
self . inner . try_lock ( )
778
781
}
779
782
780
- /// Try to acquire a shared (non-exclusive) advisory lock on the file.
783
+ /// Try to acquire a shared (non-exclusive) lock on the file.
781
784
///
782
785
/// Returns `Ok(false)` if an exclusive lock is already held on this file (via another
783
786
/// handle/descriptor).
784
787
///
785
- /// This acquires a shared advisory lock; more than one file handle may hold a shared lock, but
786
- /// none may hold an exclusive lock at the same time.
788
+ /// This acquires a shared lock; more than one file handle may hold a shared lock, but none may
789
+ /// hold an exclusive lock at the same time.
787
790
///
788
- /// If this file handle, or a clone of it, already holds an advisory lock, the exact behavior is
791
+ /// If this file handle, or a clone of it, already holds an lock, the exact behavior is
789
792
/// unspecified and platform dependent, including the possibility that it will deadlock.
790
793
/// However, if this method returns `Ok(true)`, then it has acquired a shared lock.
791
794
///
792
- /// Note, this is an advisory lock meant to interact with [`lock`], [`try_lock`],
793
- /// [`try_lock`], and [`unlock`]. Its interactions with other methods, such as [`read`]
794
- /// and [`write`] are platform specific, and it may or may not cause non-lockholders to block.
795
+ /// This lock may be advisory or mandatory. This lock is meant to interact with [`lock`],
796
+ /// [`try_lock`], [`lock_shared`], [`try_lock_shared`], and [`unlock`]. Its interactions with
797
+ /// other methods, such as [`read`] and [`write`] are platform specific, and it may or may not
798
+ /// cause non-lockholders to block.
795
799
///
796
800
/// The lock will be released when this file (along with any other file descriptors/handles
797
801
/// duplicated or inherited from it) is closed, or if the [`unlock`] method is called.
@@ -808,6 +812,7 @@ impl File {
808
812
/// [`lock`]: File::lock
809
813
/// [`lock_shared`]: File::lock_shared
810
814
/// [`try_lock`]: File::try_lock
815
+ /// [`try_lock_shared`]: File::try_lock_shared
811
816
/// [`unlock`]: File::unlock
812
817
/// [`read`]: Read::read
813
818
/// [`write`]: Write::write
0 commit comments