diff options
author | Kevin Leimkuhler <kevin@kleimkuhler.com> | 2020-01-22 13:22:10 -0800 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2020-01-22 13:22:10 -0800 |
commit | 7f580071f3e5d475db200d2101ff35be0b4f6efe (patch) | |
tree | 34da374a2d15e13f7e7e8b309f8d6d14cfcd128a /tokio/src/sync/tests | |
parent | 5fe2df0fbac79d96913d65612d88bb41c640a1ca (diff) |
net: add `ReadHalf::{poll,poll_peak}` (#2151)
The `&mut self` requirements for `TcpStream` methods ensure that there are at
most two tasks using the stream--one for reading and one for writing.
`TcpStream::split` allows two separate tasks to hold a reference to a single
`TcpStream`. `TcpStream::{peek,poll_peek}` only poll for read readiness, and
therefore are safe to use with a `ReadHalf`.
Instead of duplicating `TcpStream::poll_peek`, a private method is now used by
both `poll_peek` methods that uses the fact that only a `&TcpStream` is
required.
Closes #2136
Diffstat (limited to 'tokio/src/sync/tests')
0 files changed, 0 insertions, 0 deletions