From 8e3f55dadaa29545a94d0a2224487c8e4ad3aa4b Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Mon, 12 Apr 2021 16:44:43 +0200 Subject: [PATCH 1/3] chore: prepare Tokio v1.5.0 --- tokio/CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++ tokio/Cargo.toml | 4 ++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 13c8f4ced4a..080892064de 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,51 @@ +# 1.5.0 (April 12, 2021) + +### Added + +- io: add `AsyncSeekExt::stream_position` ([#3650]) +- io: add `AsyncWriteExt::write_vectored` ([#3678]) +- io: add a `copy_bidirectional` utility ([#3572]) +- net: implement `IntoRawFd` for `TcpSocket` ([#3684]) +- sync: add `OnceCell` ([#3591]) +- sync: add `OwnedRwLockReadGuard` and `OwnedRwLockWriteGuard` ([#3340]) +- sync: add `Semaphore::is_closed` ([#3673]) +- sync: add `mpsc::Sender::capacity` ([#3690]) +- sync: allow configuring `RwLock` max reads ([#3644]) +- task: add `sync_scope` for `LocalKey` ([#3612]) + +### Fixed + +- chore: try to avoid `noalias` attributes on intrusive linked list ([#3654]) +- rt: fix panic in `JoinHandle::abort()` when called from other threads ([#3672]) +- sync: don't panic in `oneshot::try_recv` ([#3674]) +- sync: fix notifications getting dropped on receiver drop ([#3652]) + +### Documented + +- io: clarify requirements of `AsyncFd` ([#3635]) +- runtime: fix unclear docs for `{Handle,Runtime}::block_on` ([#3628]) +- sync: document that `Semaphore` is fair ([#3693]) +- sync: improve doc on blocking mutex ([#3645]) + +[#3340]: https://github.com/tokio-rs/tokio/pull/3340 +[#3572]: https://github.com/tokio-rs/tokio/pull/3572 +[#3591]: https://github.com/tokio-rs/tokio/pull/3591 +[#3612]: https://github.com/tokio-rs/tokio/pull/3612 +[#3628]: https://github.com/tokio-rs/tokio/pull/3628 +[#3635]: https://github.com/tokio-rs/tokio/pull/3635 +[#3644]: https://github.com/tokio-rs/tokio/pull/3644 +[#3645]: https://github.com/tokio-rs/tokio/pull/3645 +[#3650]: https://github.com/tokio-rs/tokio/pull/3650 +[#3652]: https://github.com/tokio-rs/tokio/pull/3652 +[#3654]: https://github.com/tokio-rs/tokio/pull/3654 +[#3672]: https://github.com/tokio-rs/tokio/pull/3672 +[#3673]: https://github.com/tokio-rs/tokio/pull/3673 +[#3674]: https://github.com/tokio-rs/tokio/pull/3674 +[#3678]: https://github.com/tokio-rs/tokio/pull/3678 +[#3684]: https://github.com/tokio-rs/tokio/pull/3684 +[#3690]: https://github.com/tokio-rs/tokio/pull/3690 +[#3693]: https://github.com/tokio-rs/tokio/pull/3693 + # 1.4.0 (March 20, 2021) ### Added diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index f81b017e330..63c78426a7d 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -7,12 +7,12 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.4.0" +version = "1.5.0" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" readme = "README.md" -documentation = "https://docs.rs/tokio/1.4.0/tokio/" +documentation = "https://docs.rs/tokio/1.5.0/tokio/" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" description = """ From b3231ecd68900a26c5068480fb0bb39c5fb7e35d Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Mon, 12 Apr 2021 19:01:56 +0200 Subject: [PATCH 2/3] Rename new_with_max_reads --- tokio/src/sync/rwlock.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tokio/src/sync/rwlock.rs b/tokio/src/sync/rwlock.rs index f06f83d81d7..6f0c0115cf4 100644 --- a/tokio/src/sync/rwlock.rs +++ b/tokio/src/sync/rwlock.rs @@ -216,13 +216,13 @@ impl RwLock { /// ``` /// use tokio::sync::RwLock; /// - /// let lock = RwLock::new_with_max_reads(5, 1024); + /// let lock = RwLock::with_max_readers(5, 1024); /// ``` /// /// # Panics /// /// Panics if `max_reads` is more than `u32::MAX >> 3`. - pub fn new_with_max_reads(value: T, max_reads: u32) -> RwLock + pub fn with_max_readers(value: T, max_reads: u32) -> RwLock where T: Sized, { @@ -268,11 +268,11 @@ impl RwLock { /// ``` /// use tokio::sync::RwLock; /// - /// static LOCK: RwLock = RwLock::const_new_with_max_reads(5, 1024); + /// static LOCK: RwLock = RwLock::const_with_max_readers(5, 1024); /// ``` #[cfg(all(feature = "parking_lot", not(all(loom, test))))] #[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))] - pub const fn const_new_with_max_reads(value: T, mut max_reads: u32) -> RwLock + pub const fn const_with_max_readers(value: T, mut max_reads: u32) -> RwLock where T: Sized, { From 09dc4ef453a9cab819983355a1d2e8f17448a300 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Mon, 12 Apr 2021 20:38:45 +0200 Subject: [PATCH 3/3] Fix test --- tokio/tests/sync_rwlock.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/tests/sync_rwlock.rs b/tokio/tests/sync_rwlock.rs index 312247ec34c..e12052b7b6e 100644 --- a/tokio/tests/sync_rwlock.rs +++ b/tokio/tests/sync_rwlock.rs @@ -54,7 +54,7 @@ fn read_exclusive_pending() { // should be made available when one of the shared acesses is dropped #[test] fn exhaust_reading() { - let rwlock = RwLock::new_with_max_reads(100, 1024); + let rwlock = RwLock::with_max_readers(100, 1024); let mut reads = Vec::new(); loop { let mut t = spawn(rwlock.read());