3383 Commits

Author SHA1 Message Date
Carl Lerche
f3ce29a003
chore: prepare Tokio v1.20.4 release tokio-1.20.4 2023-01-17 11:09:42 -08:00
Carl Lerche
0d8fe5fe75
Merge branch 'tokio-1.18.x' into tokio-1.20.x 2023-01-17 11:08:06 -08:00
Taiki Endo
171ce0ff8d chore: prepare Tokio v1.18.5 release tokio-1.18.5 2023-01-17 23:00:38 +09:00
Taiki Endo
d6ea7a742b Add T: Unpin bound to ReadHalf::unsplit 2023-01-17 21:53:54 +09:00
Alice Ryhl
06f1a601bb
task: clarify doc about tasks starting immediately (#5364) 2023-01-14 11:11:45 -08:00
Taiki Endo
40782efb76
tokio: fix remaining issues about atomic_u64_static_once_cell.rs (#5374)
Fixes #5373
Closes #5358 

- Add check for no_atomic_u64 & no_const_mutex_new (condition to atomic_u64_static_once_cell.rs is compiled)
- Allow unused_imports in TARGET_ATOMIC_U64_PROBE. I also tested other *_PROBE and found no other errors triggered by -D warning.
- Fix cfg of util::once_cell module
2023-01-14 11:11:05 -08:00
Steven Fackler
c390a62387
Add broadcast::Sender::len (#5343)
* Add broadcast::Sender::len

* Add a randomized test for broadcast::Sender::len

* fix wasm build

* less silly cfg

* review feedback

* grammar?
2023-01-12 13:53:31 -05:00
Tymoteusz Wiśniewski
f9dbfa8251
net: improve from_std docs regarding non-blocking IO (#5332) 2023-01-11 12:56:27 +00:00
Alice Ryhl
31c7e82919
chore: prepare Tokio v1.24.1 (#5357) tokio-1.24.1 2023-01-06 10:48:42 +00:00
David Tolnay
8d8db27442
tokio: add load and compare_exchange_weak to loom StaticAtomicU64 (#5356) 2023-01-06 15:19:31 +09:00
Carl Lerche
dfe252d1fa
chore: prepare Tokio v1.24.0 release (#5353) tokio-1.24.0 2023-01-05 11:20:35 -08:00
Paul Loyd
21b233fa9c
test: bump version of async-stream (#5347) 2023-01-05 11:02:07 +01:00
Carl Lerche
72993044e6
Merge branch 'tokio-1.23.x' into master 2023-01-04 11:36:07 -08:00
Carl Lerche
1a997ffbd6
chore: prepare Tokio v1.23.1 release tokio-1.23.1 2023-01-04 10:32:38 -08:00
Carl Lerche
a8fe333cc4
Merge branch 'tokio-1.20.x' into tokio-1.23.x 2023-01-03 15:06:02 -08:00
Carl Lerche
ba81945ffc
chore: prepare Tokio 1.20.3 release tokio-1.20.3 2023-01-03 13:28:44 -08:00
Carl Lerche
763bdc967e
ci: run WASI tasks using latest Rust
This should let CI to pass.
2023-01-03 13:28:43 -08:00
Carl Lerche
9f98535877
Merge remote-tracking branch 'origin/tokio-1.18.x' into fix-named-pipes-1.20 2023-01-03 13:12:20 -08:00
Carl Lerche
9241c3eddf chore: prepare Tokio v1.18.4 release tokio-1.18.4 2023-01-03 13:06:27 -08:00
Carl Lerche
699573d550 net: fix named pipes server configuration builder
The `pipe_mode` function would erase any previously set configuration
option that is specified using the pipe_mode fit field. This patch fixes
the builder to maintain the bit field when changing the pipe mode.
2023-01-03 13:06:27 -08:00
Carl Lerche
c6552c5680
rt: use internal ThreadId implementation (#5329)
The version provided by `std` has limitations, including no way to try
to get a thread ID without panicking.
2022-12-30 15:17:35 -08:00
Carl Lerche
048049f888
rt: move task::Id into its own file (#5327)
This is a minor internal cleanup.
2022-12-30 10:49:45 -08:00
Taiki Endo
98d484e29c
ci: update cargo-check-external-types to 0.1.6 (#5325) 2022-12-30 19:03:44 +09:00
Taiki Endo
ef0224246b
tests: fix SB violation in LeakedBuffers (#5322) 2022-12-29 11:46:08 +09:00
icedrocket
4a4f80ca70
fs: use chunks in fs::read_dir (#5309) 2022-12-28 12:06:46 +01:00
Hyeonu Park
9af2f5ee59
io: optimize shutdown check on I/O operations (#5300)
The global flag remains and is used to prevent duplicated shutdowns and
new io operations after shutdown.

On shutdown, the driver flips the shutdown flag of every pending io
operations and wake them to fail with a shutdown error.

Fixes: #5227
2022-12-27 10:40:41 -08:00
Taiki Endo
b75dba6904
ci: update Swatinem/rust-cache action to v2 (#5320) 2022-12-28 02:20:12 +09:00
Lencerf
353e5cabb8
process: fix typo in process:👿:Pipe comment (#5314)
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2022-12-27 15:50:12 +00:00
Alice Ryhl
8d58dc85b5
sync: document that there is no spsc and spmc channel (#5306) 2022-12-27 16:24:50 +01:00
Taiki Endo
519afd4458
ci: remove uses of unmaintained actions-rs actions (#5316)
- Use dtolnay/rust-toolchain instead of actions-rs/toolchain
- Use cargo/cross directly instead of actions-rs/cargo
- Use rustsec/audit-check instead of actions-rs/audit-check
2022-12-28 00:06:56 +09:00
Pure White
682e93df93
rt: read environment variable for worker thread count (#4250) 2022-12-21 15:43:35 +01:00
Alice Ryhl
b9ae7e6659
signal: remove redundant Pin around globals (#5303) 2022-12-18 09:42:59 +01:00
Abutalib Aghayev
d9e0f66113
task: rename State::has_join_waker to State::is_join_waker_set (#5248) 2022-12-17 22:34:12 +01:00
Alice Ryhl
6b3727d580
metrics: make num_idle_blocking_threads test less flaky (#5302) 2022-12-17 19:06:30 +01:00
Jason Orendorff
e14ca72e68
test-util: don't auto-advance time when a spawn_blocking task is running (#5115) 2022-12-17 13:02:18 +01:00
John Nunley
42db755ac1
tokio: improve detection of whether a target supports AtomicU64 (#5284) 2022-12-16 19:53:35 +01:00
John Nunley
81b50e946f
sync: decrease stack usage in mpsc channel (#5294) 2022-12-15 22:48:00 +01:00
Carl Lerche
39766220f4
rt: implement task::Id using StaticAtomicU64 (#5282)
This patch simplifies the implementation of `task::Id` by moving
conditional compilation into the `AtomicU64` definition. To handle
platforms that do not include `const fn Mutex::new()`, `StaticAtomicU64`
is defined as always having a `const fn new()`. `StaticAtomicU64` is
implemented with `OnceCell` when needed.
2022-12-10 13:49:16 -08:00
Matt Fellenz
ae69d11d1f
util: remove Encoder bound on FramedParts constructor (#5280) 2022-12-09 11:12:42 +00:00
Carl Lerche
c693ccd210
ci: test no const mutex new (#5257)
This adds CI coverage for a couple of code paths that are not currently
hit in CI:

* no `const fn Mutex::new`
* no `AtomicU64`

This is done by adding some new CFG flags used only for tests in order
to force those code paths.
2022-12-09 02:13:22 +09:00
Divy Srivastava
36039d0bb9
rt: allow configuring I/O events capacity (#5186)
Adds a method `Builder::max_io_events_per_tick()` to the runtime builder. This can be used to configure the capacity of events that may be processed per OS poll.
2022-12-07 12:15:03 -06:00
Carl Lerche
22cff80048
chore: update CI's clippy version to 1.65 (#5276) 2022-12-06 19:56:13 -08:00
Alan Somers
07da5e73ee
ci: update CI environment to FreeBSD 12.4 (#5272)
12.3 will soon be EoL
2022-12-06 10:03:51 +01:00
Alan Somers
c4ed16d1b4
ci: future-proof for FreeBSD 12 (#5260)
Raise the mio-aio dev dependency, which transitively brings in Nix, to
ensure that the tests will continue to compile if libc switches from a
FreeBSD 11 ABI to a FreeBSD 12 one.
2022-12-06 10:03:09 +01:00
Carl Lerche
3ce5a2681c
chore: prepare Tokio v1.23 release (#5270)
### Fixed
 - net: fix Windows named pipe connect ([#5208])
 - io: support vectored writes for `ChildStdin` ([#5216])
 - io: fix `async fn ready()` false positive for OS-specific events ([#5231])

 ### Changed
 - runtime: `yield_now` defers task until after driver poll ([#5223])
 - runtime: reduce amount of codegen needed per spawned task ([#5213])
 - windows: replace `winapi` dependency with `windows-sys` ([#5204])

 [#5208]: https://github.com/tokio-rs/tokio/pull/5208
 [#5216]: https://github.com/tokio-rs/tokio/pull/5216
 [#5213]: https://github.com/tokio-rs/tokio/pull/5213
 [#5204]: https://github.com/tokio-rs/tokio/pull/5204
 [#5223]: https://github.com/tokio-rs/tokio/pull/5223
 [#5231]: https://github.com/tokio-rs/tokio/pull/5231
tokio-1.23.0
2022-12-05 15:22:43 -08:00
Tymoteusz Wiśniewski
644cb8207d
rt: fix *_closed false positives (#5231)
Readiness futures inconsistently return the current readiness of an I/O resource if it is immediately available, or all readiness relevant for the given `Interest`, if a future needs to wait. In particular, it always returns `read_closed` for `Interest::READABLE` and `write_closed` for `Interest::WRITABLE`, which often is not true. Tokio should not tolerate false positives for `*_closed` events because they are considered final states and are not cleared internally.

In the case of an `io_resource.ready(Interest::READABLE | Interest::WRITABLE)` call, this behavior may also lead to false positives of other events.

## Solution

Follow the same strategy as `poll_ready` and return the current resource's readiness.

Closes: #5098
2022-12-05 14:42:49 -08:00
Jiahao XU
a1316cd792
io: impl std::io::BufRead on SyncIoBridge<T> (#5265)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-05 10:11:44 +01:00
sharnoff
86ffabe2af
docs: add note about current-thread + Handle::block_on (#5264)
There's already an existing warning about this combo in the
documentation for `Handle::block_on`. This commit adds a summarized
version in `Runtime::handle`.
2022-12-05 00:14:05 -06:00
Vitalii Kryvenko
00bf5ee8a8
sync: improve watch docs (#5261) 2022-12-04 00:06:12 +00:00
Tilman
87510100ce
Fix typo (#5255) 2022-12-03 10:49:55 +00:00