aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2021-08-25 12:33:10 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-25 12:33:10 +0000
commit392cf0a187d6a58e28a43d3e6477c31e08640e60 (patch)
tree4b0e62f2e6c5e32ade50e8b362479668db60ff7b
parent7031ed3014b8c32e840aac9074216bd322a6c586 (diff)
parentb7e7ce24aff3dad3b3dcbc5e40d00c48179ce1f6 (diff)
downloadtokio-392cf0a187d6a58e28a43d3e6477c31e08640e60.tar.gz
Upgrade tokio to 1.10.1 am: d61267ffdf am: 5995a2b9e7 am: b4663de2ac am: e2bd347716 am: b7e7ce24af
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tokio/+/1806593 Change-Id: I3783fb2fd675cf3ebd293175e649f45f7ad171e2
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp2
-rw-r--r--CHANGELOG.md8
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA6
-rw-r--r--README.md2
-rw-r--r--src/runtime/task/mod.rs10
-rw-r--r--src/runtime/tests/task.rs6
9 files changed, 30 insertions, 10 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 179bec2..755a957 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "c0974bad94a06aaf04b62ba1397a8cfe5eb2fcb6"
+ "sha1": "dd060b16f54ce196b3891042030dedd3abc017c4"
}
}
diff --git a/Android.bp b/Android.bp
index 5d0587a..2e08e9e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -23,7 +23,7 @@ rust_library {
host_supported: true,
crate_name: "tokio",
cargo_env_compat: true,
- cargo_pkg_version: "1.10.0",
+ cargo_pkg_version: "1.10.1",
srcs: ["src/lib.rs"],
edition: "2018",
features: [
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 55b120f..3b41957 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+# 1.10.1 (August 24, 2021)
+
+### Fixed
+
+ - runtime: fix leak in UnownedTask ([#4063])
+
+[#4063]: https://github.com/tokio-rs/tokio/pull/4063
+
# 1.10.0 (August 12, 2021)
### Added
diff --git a/Cargo.toml b/Cargo.toml
index daaa1e6..768583f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "tokio"
-version = "1.10.0"
+version = "1.10.1"
authors = ["Tokio Contributors <team@tokio.rs>"]
description = "An event-driven, non-blocking I/O platform for writing asynchronous I/O\nbacked applications.\n"
homepage = "https://tokio.rs"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index da8e4b6..90455fb 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -7,7 +7,7 @@ name = "tokio"
# - README.md
# - Update CHANGELOG.md.
# - Create "v1.0.x" git tag.
-version = "1.10.0"
+version = "1.10.1"
edition = "2018"
authors = ["Tokio Contributors <team@tokio.rs>"]
license = "MIT"
diff --git a/METADATA b/METADATA
index 784493d..4a93f8b 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/tokio/tokio-1.10.0.crate"
+ value: "https://static.crates.io/crates/tokio/tokio-1.10.1.crate"
}
- version: "1.10.0"
+ version: "1.10.1"
license_type: NOTICE
last_upgrade_date {
year: 2021
month: 8
- day: 17
+ day: 25
}
}
diff --git a/README.md b/README.md
index a06d873..80f75be 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:
```toml
[dependencies]
-tokio = { version = "1.10.0", features = ["full"] }
+tokio = { version = "1.10.1", features = ["full"] }
```
Then, on your main.rs:
diff --git a/src/runtime/task/mod.rs b/src/runtime/task/mod.rs
index cc3910d..5f0d5ab 100644
--- a/src/runtime/task/mod.rs
+++ b/src/runtime/task/mod.rs
@@ -369,10 +369,16 @@ impl<S: Schedule> UnownedTask<S> {
let raw = self.raw;
mem::forget(self);
- // Poll the task
+ // Transfer one ref-count to a Task object.
+ let task = Task::<S> {
+ raw,
+ _p: PhantomData,
+ };
+
+ // Use the other ref-count to poll the task.
raw.poll();
// Decrement our extra ref-count
- raw.header().state.ref_dec();
+ drop(task);
}
pub(crate) fn shutdown(self) {
diff --git a/src/runtime/tests/task.rs b/src/runtime/tests/task.rs
index e93a1ef..04e1b56 100644
--- a/src/runtime/tests/task.rs
+++ b/src/runtime/tests/task.rs
@@ -112,6 +112,12 @@ fn create_shutdown2() {
}
#[test]
+fn unowned_poll() {
+ let (task, _) = unowned(async {}, NoopSchedule);
+ task.run();
+}
+
+#[test]
fn schedule() {
with(|rt| {
rt.spawn(async {