summaryrefslogtreecommitdiffstats
path: root/tokio/src
AgeCommit message (Collapse)Author
2020-10-27chore: prepare v0.3.2 release (#3059)Carl Lerche
2020-10-27Revert "util: upgrade tokio-util to bytes 0.6 (#3052)" (#3060)Carl Lerche
This reverts commit fe2b997. We are avoiding adding poll_read_buf to tokio itself for now. The patch is reverted now in order to not block the v0.3.2 release (#3059).
2020-10-27net: change mention of net2 (#3056)Zahari Dichev
2020-10-27util: upgrade tokio-util to bytes 0.6 (#3052)Dirkjan Ochtman
2020-10-26sync: make oneshot::Sender::poll_closed public again (#3032)Sean McArthur
2020-10-26udp: add UdpSocket::take_error (#3051)Alice Ryhl
2020-10-26oneshot: update closed() docs to use tokio::select! (#3050)Alice Ryhl
2020-10-24io: expand on de-initialization of ReadBuf (#3035)Alice Ryhl
2020-10-24docs: update docs for `from_std` functions (#3016)Zahari Dichev
Fixes: #3007
2020-10-23sync: add mem::forget to RwLockWriteGuard::downgrade. (#2957)Zahari Dichev
Currently when `RwLockWriteGuard::downgrade` the `MAX_READS - 1` permits are added to the semaphore. When `RwLockWriteGuard::drop` gets invoked however another `MAX_READS` permits are added. This results in releasing more permits that were actually aquired when downgrading a write to a read lock. This is why we need to call `mem::forget` on the `RwLockWriteGuard` in order to avoid invoking the destructor. Fixes: #2941
2020-10-22io: Add AsyncFd, fix io::driver shutdown (#2903)bdonlan
* io: Add AsyncFd This adds AsyncFd, a unix-only structure to allow for read/writability states to be monitored for arbitrary file descriptors. Issue: #2728 * driver: fix shutdown notification unreliability Previously, there was a race window in which an IO driver shutting down could fail to notify ScheduledIo instances of this state; in particular, notification of outstanding ScheduledIo registrations was driven by `Driver::drop`, but registrations bypass `Driver` and go directly to a `Weak<Inner>`. The `Driver` holds the `Arc<Inner>` keeping `Inner` alive, but it's possible that a new handle could be registered (or a new readiness future created for an existing handle) after the `Driver::drop` handler runs and prior to `Inner` being dropped. This change fixes this in two parts: First, notification of outstanding ScheduledIo handles is pushed down into the drop method of `Inner` instead, and, second, we add state to ScheduledIo to ensure that we remember that the IO driver we're bound to has shut down after the initial shutdown notification, so that subsequent readiness future registrations can immediately return (instead of potentially blocking indefinitely). Fixes: #2924
2020-10-22tokio: add back poll_* for udp (#2981)Evan Cameron
2020-10-22net: fix typo (#3023)Zhang Jingqiang
2020-10-21chore: prepare v0.3.1 release (#3021)Carl Lerche
2020-10-21sync: revert Clone impl for broadcast::Receiver (#3020)Carl Lerche
The `Receiver` handle maintains a position in the broadcast channel for itself. Cloning implies copying the state of the value. Intuitively, cloning a `broadcast::Receiver` would return a new receiver with an identical position. However, the current implementation returns a new `Receiver` positioned at the tail of the channel. This behavior subtlety is why `new_subscriber()` is used to create `Receiver` handles. An alternate API should consider the position issue. Refs: #2933
2020-10-21net: fix use-after-free in slab compaction (#3019)Carl Lerche
An off-by-one bug results in freeing the incorrect page. This also adds an `asan` CI job. Fixes: 3014
2020-10-21io: add `AsyncReadExt::read_buf` (#3003)Carl Lerche
Brings back `read_buf` from 0.2. This will be stabilized as part of 1.0.
2020-10-21tokio: deduplicate spawn_blocking (#3017)Marc-Antoine Perennou
Move common code and tracing integration into Handle Fixes #2998 Closes #3004 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-10-21sync: add is_closed method to watch sender (#2991)Nikolai Kuklin
2020-10-21io: explain how to determine number of bytes read in AsyncRead (#3011)Zahari Dichev
Fixes: #2999
2020-10-21sync: remove extra clone in Semaphore::[try_]acquire_owned (#3015)Philip Kannegaard Hayes
2020-10-20fs: flush on shutdown (#3009)Zahari Dichev
Fixes: #2950
2020-10-19docs: adjust TcpListener::from_std documentation to match behavior (#3002)pluth
2020-10-19runtime: remove unneeded #[cfg(feature = "rt")] (#2996)Alice Ryhl
2020-10-19tokio: add Runtime::spawn_blocking (#2980)Marc-Antoine Perennou
This allows writing rt.spawn_blocking(f); instead of let _enter = rt.enter(); tokio::task::spawn_blocking(f); Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-10-19docs: fix typo in runtime module documentation (#2992)nickelc
2020-10-19io: add copy_buf (#2884)Zahari Dichev
2020-10-19sync: implement Clone for broadcast::Receiver (#2933)Zephyr Shannon
2020-10-17docs: fix typos on UdpSocket (#2979)Evan Cameron
2020-10-16doc: update version to 0.3 in module documentation (#2974)messense
2020-10-16Fix doc typo (#2967)Alice Ryhl
2020-10-16Update documentation of AsyncRead to reflect use of ReadBufJohn-John Tedro
2020-10-13rt: update docs for `0.3` changes (#2956)Lucio Franco
This PR updates the runtime module docs to the changes made in `0.3` release of tokio. Closes #2720
2020-10-13rt: tweak spawn_blocking docs (#2955)Carl Lerche
2020-10-13rt: switch `enter` to an RAII guard (#2954)Carl Lerche
2020-10-13process: update docs regarding zombie processes (#2952)Ivan Petkov
2020-10-12meta: combine `net` and `dns`, use `parking_lot` (#2951)Carl Lerche
This combines the `dns` and `net` feature flags. Previously, `dns` was included as part of `net`. Given that is is rare that one would want `dns` without `net`, DNS is now entirely gated w/ `net`. The `parking_lot` feature is included as part of `full`. Some misc docs are tweaked to reflect feature flag changes.
2020-10-12rt: simplify rt-* features (#2949)Taiki Endo
tokio: merge rt-core and rt-util as rt rename rt-threaded to rt-multi-thread tokio-util: rename rt-core to rt Closes #2942
2020-10-12chore: refactor runtime driver usage of `Either` (#2918)Ivan Petkov
2020-10-12rt: `worker_threads` must be non-zero (#2947)Lucio Franco
Co-authored-by: Alice Ryhl <alice@ryhl.io>
2020-10-13net: merge tcp, udp, uds features to net feature (#2943)Taiki Endo
2020-10-12rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876)Lucio Franco
Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Carl Lerche <me@carllerche.com>
2020-10-12time: move error types into `time::error` (#2938)Juan Alvarez
2020-10-12time: Clean up `Instant` docs to align with `std` (#2946)Lucio Franco
Co-authored-by: Alice Ryhl <alice@ryhl.io>
2020-10-12io: Rename `ReadBuf` methods (#2945)Lucio Franco
This changes `ReadBuf::add_filled` to `ReadBuf::advance` and `ReadBuf::append` to `ReadBuf::put_slice`. This is just a mechanical change. Closes #2769
2020-10-12sync: change chan `closed(&mut self)` to `closed(&self)` (#2939)Zahari Dichev
2020-10-12chore: remove use of doc_alias feature (#2944)Taiki Endo
2020-10-11net: make UCred fields private (#2936)Taiki Endo
2020-10-09sync: move broadcast error types into broadcast::error module (#2937)Taiki Endo
Refs: #2928
2020-10-09fs: future proof `File` (#2930)Carl Lerche
Changes inherent methods to take `&self` instead of `&mut self`. This brings the API in line with `std`. This patch is implemented by using a `tokio::sync::Mutex` to guard the internal `File` state. This is not an ideal implementation strategy doesn't make a big impact compared to having to dispatch operations to a background thread followed by a blocking syscall. In the future, the implementation can be improved as we explore async file-system APIs provided by the operating-system (iocp / io_uring). Closes #2927