@@ -826,6 +826,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> {
826
826
/// _actually observes_ that the file descriptor is _not_ ready. Do not call
827
827
/// it simply because, for example, a read succeeded; it should be called
828
828
/// when a read is observed to block.
829
+ ///
830
+ /// This method only clears readiness events that happened before the creation of this guard.
831
+ /// In other words, if the IO resource becomes ready between the creation of the guard and
832
+ /// this call to `clear_ready`, then the readiness is not actually cleared.
829
833
pub fn clear_ready ( & mut self ) {
830
834
if let Some ( event) = self . event . take ( ) {
831
835
self . async_fd . registration . clear_readiness ( event) ;
@@ -846,6 +850,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyGuard<'a, Inner> {
846
850
/// block. For example when a read blocks when using a combined interest,
847
851
/// only clear `Ready::READABLE`.
848
852
///
853
+ /// This method only clears readiness events that happened before the creation of this guard.
854
+ /// In other words, if the IO resource becomes ready between the creation of the guard and
855
+ /// this call to `clear_ready`, then the readiness is not actually cleared.
856
+ ///
849
857
/// # Examples
850
858
///
851
859
/// Concurrently read and write to a [`std::net::TcpStream`] on the same task without
@@ -1042,6 +1050,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyMutGuard<'a, Inner> {
1042
1050
/// _actually observes_ that the file descriptor is _not_ ready. Do not call
1043
1051
/// it simply because, for example, a read succeeded; it should be called
1044
1052
/// when a read is observed to block.
1053
+ ///
1054
+ /// This method only clears readiness events that happened before the creation of this guard.
1055
+ /// In other words, if the IO resource becomes ready between the creation of the guard and
1056
+ /// this call to `clear_ready`, then the readiness is not actually cleared.
1045
1057
pub fn clear_ready ( & mut self ) {
1046
1058
if let Some ( event) = self . event . take ( ) {
1047
1059
self . async_fd . registration . clear_readiness ( event) ;
@@ -1062,6 +1074,10 @@ impl<'a, Inner: AsRawFd> AsyncFdReadyMutGuard<'a, Inner> {
1062
1074
/// block. For example when a read blocks when using a combined interest,
1063
1075
/// only clear `Ready::READABLE`.
1064
1076
///
1077
+ /// This method only clears readiness events that happened before the creation of this guard.
1078
+ /// In other words, if the IO resource becomes ready between the creation of the guard and
1079
+ /// this call to `clear_ready`, then the readiness is not actually cleared.
1080
+ ///
1065
1081
/// # Examples
1066
1082
///
1067
1083
/// Concurrently read and write to a [`std::net::TcpStream`] on the same task without
0 commit comments