Skip to content

Commit 3fbf314

Browse files
committed
Merge 'tokio-1.20.2' into 'tokio-1.21.x' (#5057)
2 parents dea1cd4 + 3d95a46 commit 3fbf314

File tree

14 files changed

+138
-38
lines changed

14 files changed

+138
-38
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
resource_class: arm.medium
77
environment:
88
# Change to pin rust version
9-
RUST_STABLE: stable
9+
RUST_STABLE: 1.63.0
1010
steps:
1111
- checkout
1212
- run:
@@ -22,4 +22,4 @@ jobs:
2222
workflows:
2323
ci:
2424
jobs:
25-
- test-arm
25+
- test-arm

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
freebsd_instance:
22
image: freebsd-12-3-release-amd64
33
env:
4-
RUST_STABLE: stable
4+
RUST_STABLE: 1.63.0
55
RUST_NIGHTLY: nightly-2022-03-21
66
RUSTFLAGS: -D warnings
77

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ env:
1010
RUSTFLAGS: -Dwarnings
1111
RUST_BACKTRACE: 1
1212
# Change to specific Rust release to pin
13-
rust_stable: stable
13+
rust_stable: 1.63.0
1414
rust_nightly: nightly-2022-07-26
15-
rust_clippy: 1.52.0
15+
rust_clippy: 1.56.0
1616
# When updating this, also update:
1717
# - README.md
1818
# - tokio/README.md
@@ -298,8 +298,9 @@ jobs:
298298
toolchain: ${{ env.rust_min }}
299299
override: true
300300
- uses: Swatinem/rust-cache@v1
301-
- name: "test --workspace --all-features"
302-
run: cargo check --workspace --all-features
301+
- name: "test --all-features"
302+
run: cargo check --all-features
303+
working-directory: tokio
303304

304305
minimal-versions:
305306
name: minimal-versions

.github/workflows/loom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
RUSTFLAGS: -Dwarnings
1212
RUST_BACKTRACE: 1
1313
# Change to specific Rust release to pin
14-
rust_stable: stable
14+
rust_stable: 1.63.0
1515

1616
jobs:
1717
loom:

.github/workflows/stress-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
RUSTFLAGS: -Dwarnings
1010
RUST_BACKTRACE: 1
1111
# Change to specific Rust release to pin
12-
rust_stable: stable
12+
rust_stable: 1.63.0
1313

1414
jobs:
1515
stress-test:

examples/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ serde_derive = "1.0"
2121
serde_json = "1.0"
2222
httparse = "1.0"
2323
httpdate = "1.0"
24-
once_cell = "1.5.2"
2524
rand = "0.8.3"
2625

2726
[target.'cfg(windows)'.dev-dependencies.winapi]
@@ -71,11 +70,6 @@ path = "udp-codec.rs"
7170
name = "tinyhttp"
7271
path = "tinyhttp.rs"
7372

74-
[[example]]
75-
name = "custom-executor"
76-
path = "custom-executor.rs"
77-
78-
7973
[[example]]
8074
name = "custom-executor-tokio-context"
8175
path = "custom-executor-tokio-context.rs"

tokio/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ wasm32-wasi target is given unstable support for the `net` feature.
103103
[#4956]: https://github.com/tokio-rs/tokio/pull/4956
104104
[#4959]: https://github.com/tokio-rs/tokio/pull/4959
105105

106+
# 1.20.2 (September 27, 2022)
107+
108+
This release removes the dependency on the `once_cell` crate to restore the MSRV
109+
of the 1.20.x LTS release. ([#5048])
110+
111+
[#5048]: https://github.com/tokio-rs/tokio/pull/5048
112+
106113
# 1.20.1 (July 25, 2022)
107114

108115
### Fixed
@@ -221,6 +228,13 @@ This release fixes a bug in `Notified::enable`. ([#4747])
221228
[#4729]: https://github.com/tokio-rs/tokio/pull/4729
222229
[#4739]: https://github.com/tokio-rs/tokio/pull/4739
223230

231+
# 1.18.3 (September 27, 2022)
232+
233+
This release removes the dependency on the `once_cell` crate to restore the MSRV
234+
of the 1.18.x LTS release. ([#5048])
235+
236+
[#5048]: https://github.com/tokio-rs/tokio/pull/5048
237+
224238
# 1.18.2 (May 5, 2022)
225239

226240
Add missing features for the `winapi` dependency. ([#4663])

tokio/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ net = [
6363
]
6464
process = [
6565
"bytes",
66-
"once_cell",
6766
"libc",
6867
"mio/os-poll",
6968
"mio/os-ext",
@@ -77,13 +76,12 @@ process = [
7776
"winapi/winnt",
7877
]
7978
# Includes basic task execution capabilities
80-
rt = ["once_cell"]
79+
rt = []
8180
rt-multi-thread = [
8281
"num_cpus",
8382
"rt",
8483
]
8584
signal = [
86-
"once_cell",
8785
"libc",
8886
"mio/os-poll",
8987
"mio/net",
@@ -112,7 +110,6 @@ pin-project-lite = "0.2.0"
112110

113111
# Everything else is optional...
114112
bytes = { version = "1.0.0", optional = true }
115-
once_cell = { version = "1.5.2", optional = true }
116113
memchr = { version = "2.2", optional = true }
117114
mio = { version = "0.8.4", optional = true }
118115
num_cpus = { version = "1.8.0", optional = true }

tokio/src/loom/std/parking_lot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<T> Mutex<T> {
5252
}
5353

5454
#[inline]
55-
#[cfg(all(feature = "parking_lot", not(all(loom, test)),))]
55+
#[cfg(all(feature = "parking_lot", not(all(loom, test))))]
5656
#[cfg_attr(docsrs, doc(cfg(all(feature = "parking_lot",))))]
5757
pub(crate) const fn const_new(t: T) -> Mutex<T> {
5858
Mutex(PhantomData, parking_lot::const_mutex(t))

tokio/src/process/unix/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ use crate::process::kill::Kill;
3434
use crate::process::SpawnedChild;
3535
use crate::signal::unix::driver::Handle as SignalHandle;
3636
use crate::signal::unix::{signal, Signal, SignalKind};
37+
use crate::util::once_cell::OnceCell;
3738

3839
use mio::event::Source;
3940
use mio::unix::SourceFd;
40-
use once_cell::sync::Lazy;
4141
use std::fmt;
4242
use std::fs::File;
4343
use std::future::Future;
@@ -64,25 +64,29 @@ impl Kill for StdChild {
6464
}
6565
}
6666

67-
static ORPHAN_QUEUE: Lazy<OrphanQueueImpl<StdChild>> = Lazy::new(OrphanQueueImpl::new);
67+
fn get_orphan_queue() -> &'static OrphanQueueImpl<StdChild> {
68+
static ORPHAN_QUEUE: OnceCell<OrphanQueueImpl<StdChild>> = OnceCell::new();
69+
70+
ORPHAN_QUEUE.get(OrphanQueueImpl::new)
71+
}
6872

6973
pub(crate) struct GlobalOrphanQueue;
7074

7175
impl fmt::Debug for GlobalOrphanQueue {
7276
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
73-
ORPHAN_QUEUE.fmt(fmt)
77+
get_orphan_queue().fmt(fmt)
7478
}
7579
}
7680

7781
impl GlobalOrphanQueue {
7882
fn reap_orphans(handle: &SignalHandle) {
79-
ORPHAN_QUEUE.reap_orphans(handle)
83+
get_orphan_queue().reap_orphans(handle)
8084
}
8185
}
8286

8387
impl OrphanQueue<StdChild> for GlobalOrphanQueue {
8488
fn push_orphan(&self, orphan: StdChild) {
85-
ORPHAN_QUEUE.push_orphan(orphan)
89+
get_orphan_queue().push_orphan(orphan)
8690
}
8791
}
8892

0 commit comments

Comments
 (0)