Skip to content

Commit

Permalink
keep original interest for PollEvented::new
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Apr 5, 2023
1 parent f7a4d28 commit 026a41d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tokio/src/io/poll_evented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,12 @@ cfg_io_driver! {

// ===== impl PollEvented =====

#[cfg(not(any(target_os = "linux", target_os = "android")))]
const ALL_INTEREST: Interest = Interest::READABLE.add(Interest::WRITABLE);

#[cfg(any(target_os = "linux", target_os = "android"))]
const ALL_INTEREST: Interest = Interest::READABLE
.add(Interest::WRITABLE)
.add(Interest::PRIORITY);

impl<E: Source> PollEvented<E> {
/// Creates a new `PollEvented` associated with the default reactor.
///
/// The returned `PollEvented` has readable and writable interests. For more control, use
/// [`Self::new_with_interest`].
///
/// # Panics
///
/// This function panics if thread-local runtime is not set.
Expand All @@ -91,7 +86,7 @@ impl<E: Source> PollEvented<E> {
#[track_caller]
#[cfg_attr(feature = "signal", allow(unused))]
pub(crate) fn new(io: E) -> io::Result<Self> {
PollEvented::new_with_interest(io, ALL_INTEREST)
PollEvented::new_with_interest(io, Interest::READABLE | Interest::WRITABLE)
}

/// Creates a new `PollEvented` associated with the default reactor, for
Expand Down

0 comments on commit 026a41d

Please sign in to comment.