mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
io: add doc warning about concurrently calling poll_read/write_ready (#2439)
Co-authored-by: Alice Ryhl <alice@ryhl.io> Fixes: #2429
This commit is contained in:
parent
6aeeeff6e8
commit
3ba818a177
@ -261,6 +261,11 @@ where
|
|||||||
///
|
///
|
||||||
/// * `ready` includes writable.
|
/// * `ready` includes writable.
|
||||||
/// * called from outside of a task context.
|
/// * called from outside of a task context.
|
||||||
|
///
|
||||||
|
/// # Warning
|
||||||
|
///
|
||||||
|
/// This method may not be called concurrently. It takes `&self` to allow
|
||||||
|
/// calling it concurrently with `poll_write_ready`.
|
||||||
pub fn poll_read_ready(
|
pub fn poll_read_ready(
|
||||||
&self,
|
&self,
|
||||||
cx: &mut Context<'_>,
|
cx: &mut Context<'_>,
|
||||||
@ -327,6 +332,11 @@ where
|
|||||||
///
|
///
|
||||||
/// * `ready` contains bits besides `writable` and `hup`.
|
/// * `ready` contains bits besides `writable` and `hup`.
|
||||||
/// * called from outside of a task context.
|
/// * called from outside of a task context.
|
||||||
|
///
|
||||||
|
/// # Warning
|
||||||
|
///
|
||||||
|
/// This method may not be called concurrently. It takes `&self` to allow
|
||||||
|
/// calling it concurrently with `poll_read_ready`.
|
||||||
pub fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<mio::Ready>> {
|
pub fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<mio::Ready>> {
|
||||||
poll_ready!(
|
poll_ready!(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user