mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +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.
|
||||
/// * 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(
|
||||
&self,
|
||||
cx: &mut Context<'_>,
|
||||
@ -327,6 +332,11 @@ where
|
||||
///
|
||||
/// * `ready` contains bits besides `writable` and `hup`.
|
||||
/// * 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>> {
|
||||
poll_ready!(
|
||||
self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user