Skip to content

Commit 2063d66

Browse files
committed
Merge 'tokio-1.18.3' into 'tokio-1.20.x' (#5054)
2 parents c0746b6 + 5c76d07 commit 2063d66

File tree

14 files changed

+131
-38
lines changed

14 files changed

+131
-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.62.1
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.62.1
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.62.1
1414
rust_nightly: nightly-2022-04-18
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
@@ -295,8 +295,9 @@ jobs:
295295
toolchain: ${{ env.rust_min }}
296296
override: true
297297
- uses: Swatinem/rust-cache@v1
298-
- name: "test --workspace --all-features"
299-
run: cargo check --workspace --all-features
298+
- name: "test --all-features"
299+
run: cargo check --all-features
300+
working-directory: tokio
300301

301302
minimal-versions:
302303
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.62.1
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.62.1
1313

1414
jobs:
1515
stess-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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ This release fixes a bug in `Notified::enable`. ([#4747])
116116
[#4729]: https://github.com/tokio-rs/tokio/pull/4729
117117
[#4739]: https://github.com/tokio-rs/tokio/pull/4739
118118

119+
# 1.18.3 (September 27, 2022)
120+
121+
This release removes the dependency on the `once_cell` crate to restore the MSRV
122+
of the 1.18.x LTS release. ([#5048])
123+
124+
[#5048]: https://github.com/tokio-rs/tokio/pull/5048
125+
119126
# 1.18.2 (May 5, 2022)
120127

121128
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
@@ -61,7 +61,6 @@ net = [
6161
]
6262
process = [
6363
"bytes",
64-
"once_cell",
6564
"libc",
6665
"mio/os-poll",
6766
"mio/os-ext",
@@ -75,13 +74,12 @@ process = [
7574
"winapi/minwindef",
7675
]
7776
# Includes basic task execution capabilities
78-
rt = ["once_cell"]
77+
rt = []
7978
rt-multi-thread = [
8079
"num_cpus",
8180
"rt",
8281
]
8382
signal = [
84-
"once_cell",
8583
"libc",
8684
"mio/os-poll",
8785
"mio/net",
@@ -110,7 +108,6 @@ pin-project-lite = "0.2.0"
110108

111109
# Everything else is optional...
112110
bytes = { version = "1.0.0", optional = true }
113-
once_cell = { version = "1.5.2", optional = true }
114111
memchr = { version = "2.2", optional = true }
115112
mio = { version = "0.8.1", optional = true }
116113
socket2 = { version = "0.4.4", optional = true, features = [ "all" ] }

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)