Commit Graph
3050 Commits
Author SHA1 Message Date
Taiki Endo b891714bdb ci: use --feature-powerset --depth 2 in features check (#5007)
As has been pointed out a few times in the past (e.g., #4036 (comment)), each-feature 
is not sufficient for features check.

Ideally, we'd like to check all combinations of features, but there are too many
combinations. So limit the max number of simultaneous feature flags to 2 by --depth
option. I think this should be sufficient in most cases as @carllerche said in
taiki-e/cargo-hack#58.
2022-09-13 11:05:38 -07:00
Jernej Kos 0fddb765d4 ci: add build test for x86_64-fortanix-unknown-sgx target (#5001) 2022-09-13 15:12:35 +02:00
Alice Ryhl 29e3584c4d ci: don't auto-cancel CI on old commits on master (#5006) 2022-09-13 13:13:27 +02:00
Alice Ryhl 0d68bef7f7 Merge 'tokio-1.21.1' into 'master' 2022-09-13 11:43:54 +02:00
Alice Ryhl dea1cd4995 chore: prepare Tokio v1.21.1 (#5003) tokio-1.21.1 2022-09-13 11:20:59 +02:00
Alice Ryhl e4cbc70279 task: ignore failure to set TLS in LocalSet Drop (#4976) 2022-09-13 08:51:04 +02:00
Alice Ryhl 97e981e797 net: fix dependency resolution for socket2 (#5000) 2022-09-13 08:50:30 +02:00
Carl Lerche 3a4f18b93b rt: remove internal runtime::ToHandle trait (#5002)
The internal `runtime::ToHandle` trait is no longer needed as the
runtime handle is used everywhere now.
2022-09-12 16:18:17 -07:00
Yotam Ofek 1c823093cb codec: fix LengthDelimitedCodec buffer over-reservation (#4997) 2022-09-11 15:58:51 +02:00
Hayden Stainsby 0b1f640308 io: remove reference to missing functions from Registration docs (#4995)
The docs for `Registration::new_with_interest_and_handle` (internal
function) included a reference to two old functions `new_with_interest`
and `new` on the same struct. These functions no longer exist, which
could be confusing.

Since there is currently only a single constructor function on
`Registration`, the misleading text has simply been removed.
2022-09-09 20:36:42 +02:00
Carl Lerche d7b3b33c9c rt: move spawn_blocking methods to blocking mod (#4994)
A few spawn_blocking methods were implemented on a Handle struct that is
intended to hold all runtime driver handles. These methods make more
sense in the blocking module.
2022-09-08 13:38:20 -07:00
Carl Lerche 71b29b9409 rt: remove Handle reference from time driver (#4993)
A step towards the goal of consolidating thread-local variables, this
patch removes the `time::Handle` reference from the time driver struct.
The reference is moved a level up and passed into methods that need it.

The end goal is to have a single `Driver` struct that holds each
sub-driver and a single `Handle` ref-counted struct that holds all the
misc handles. Further work on the time driver is blocked by some other
refactoring that will happen in follow-up patches.
2022-09-08 11:42:08 -07:00
Piotr 3966acf966 io: rewrite immediate_exit_on_error test to use io::Mock (#4984) 2022-09-08 11:39:06 +02:00
Alice Ryhl dfdb550cd4 chore: prepare tokio-util 0.7.4 (#4987) tokio-util-0.7.4 2022-09-08 10:34:23 +02:00
Carl Lerche 99aa8d12b7 rt: rm internal Park,Unpark traits (#4991)
Years ago, Tokio was organized as a cluster of separate crates. This
architecture required a trait to represent "park the thread and do
work.". When all crates were combined into a single crate, the `Park`
and `Unpark` traits remained as internal details.

This patch removes these traits as they are no longer needed. This is in
service of a future refactor that will decouple the various resource
drivers and store them in a single struct instead of nesting them.
However, in the mean time, removing the Park/Unpark traits adds a bit of
messy code to make the conditional compilation work. This code will
(hopefully) be short-lived.
2022-09-07 18:39:45 -07:00
Carl Lerche 2ad347465e rt: minor time driver refactors (#4989)
This patch makes some minor refactors. It renames `ClockTime` to
`TimeSource` since that is how all variables refer to it. It also moves
the type into a new file.

Finally, it moves the `unpark` handle out of the mutex as it does not
need to be there. Note, the call to `unpark` is still called while the
mutex is held, so there is no functional change. Moving it out of the
mutex is in preparation for moving the unpark handle completely out of
the time driver.
2022-09-07 13:24:02 -07:00
Alex Rudy 291fce8de3 io: add error handling example to StreamReader (#4975) 2022-09-07 13:58:06 +00:00
Adam Chalmers 0267516214 net: fix links in UnixStream docs (#4985) 2022-09-07 08:40:55 +00:00
Carl Lerche bbfd34f6a3 rt: move time driver into runtime module (#4983)
This patch moves the time driver into the runtime module. The time driver
is a runtime concern and is only used by the runtime. Moving the drivers
is the first step to cleaning up some Tokio internals. There will be
follow-up patches that integrate the drivers and other runtime concerns
more closely.

This is an internal refactor and should not impact any public APIs.
2022-09-06 14:12:09 -07:00
Alice Ryhl 116fa7c614 task: introduce RcCell helper (#4977) 2022-09-06 13:40:07 +02:00
Hsiang-Cheng Yang 1fd7f82468 task: fix a doc typo in LocalKey::sync_scope (#4971) 2022-09-03 13:57:18 +00:00
Noah Kennedy c2612b446f io: reduce syscalls in poll_write (#4970)
This applies the same optimization made in #4840 to writes.
2022-09-02 15:23:17 -05:00
Alice Ryhl 50795e652e chore: prepare Tokio v1.21.0 (#4967) tokio-1.21.0 2022-09-02 13:51:31 +02:00
Alice Ryhl a6a95bb4a6 wasm: add documentation for wasm support (#4966) 2022-09-02 11:39:38 +02:00
Alice Ryhl ce5d2a466f task: fix some doc and test things related to stabilizing JoinSet (#4965) 2022-09-01 21:39:20 +00:00
Alice Ryhl e5467ca767 tokio: increase LTS duration to one year (#4964) 2022-09-01 21:30:51 +00:00
Jan Behrens 431ec68f93 sync: doc of watch::Sender::send improved (#4959)
Current documentation of `sync::watch::Sender::send` may be intepreted
as the method failing if at some point in past the channel has been
closed because every receiver has been dropped. This isn't true,
however, as the channel could have been reopened by using
`sync::watch::Sender::subscribe`.

This fix clarifies the behavior. Moreover, it is noted that on failure,
the value isn't made available to future subscribers (but returned as
part of the `SendError`).

Fixes #4957.
2022-09-01 21:11:01 +02:00
Alice Ryhl f207e1afe4 tokio: make 1.20.x an LTS release (#4962) 2022-09-01 21:08:31 +02:00
Alice RyhlandTaiki Endo d3cae06b5e wasm: use thread::sleep on non-wasi wasm too (#4963)
Co-authored-by: Taiki Endo <[email protected]>
2022-09-01 16:52:56 +02:00
Alice Ryhl 01ebb0aa29 task: fix warning (#4960) 2022-08-31 15:42:30 +02:00
Jon Kelley adc774bc4f Feature: Add more windows signal handlers (#4924) 2022-08-31 06:29:31 +00:00
TennyZhuang 5a2bc850af task: fix incorrect signature in Builder::spawn_on (#4953) 2022-08-30 09:23:53 +00:00
Vladimir ba93b28033 signal: make SignalKind methods const (#4956) 2022-08-29 19:47:55 +00:00
Clint Frederickson 505cc0901d time: add a comment to Interval::tick example (#4951) 2022-08-27 18:02:56 +00:00
Carl Lerche a3411a412c rt, chore: rename internal scheduler types (#4945)
For historical reasons, the current-thread runtime's scheduler was named
BasicScheduler and the multi-thread runtime's scheduler were named
ThreadPool. This patch renames the schedulers to mirror the runtime
names to increase consistency. This patch also moves the scheduler
implementations into a new `runtime::scheduler` module.
2022-08-26 09:47:19 -07:00
Carl Lerche 218f2629ff rt: move I/O driver into runtime module (#4942)
This patch moves the I/O driver into the runtime module. The I/O driver
is a runtime concern and is only used by the runtime. Moving the driver
is the first step to cleaning up some Tokio internals. There will be
follow-up patches that integrate the I/O driver and other runtime concerns
more closely.

Because `Interest` and `Ready` are public APIs, they were moved to the
top-level `io` module instead of moving the types to `runtime`.

This is an internal refactor and should not impact any public APIs.
2022-08-25 12:58:57 -07:00
Isaac Sikkema a66884a2fb net: add documentation to try_read() for zero-length buffers (#4937) 2022-08-25 09:33:25 +00:00
Carl Lerche b023522a37 rt: add unstable option to disable the LIFO slot (#4936)
The multi-threaded scheduler includes a per-worker LIFO slot to
store the last scheduled task. This can improve certain usage patterns,
especially message passing between tasks. However, this LIFO slot is not
currently stealable.

Eventually, the LIFO slot **will** become stealable. However, as a
stop-gap, this unstable option lets users disable the LIFO task when
doing so improves their application's overall performance.

Refs: #4941
2022-08-24 12:48:30 -07:00
imlk 733931d85f io: add SyncIoBridge::shutdown() (#4938) 2022-08-24 12:18:53 +00:00
Carl Lerche df28ac092f rt: extract basic_scheduler::Config (#4935) 2022-08-24 13:49:30 +02:00
John DiSanti d720770b07 ci: add cargo-check-external-types check (#4914) 2022-08-24 13:35:32 +02:00
Hayden Stainsby c9d444e8e0 doc: correct cargo doc command in contrib guide (#4933)
The command to build the documentation locally provided in the
Contribution Guide did not work for all crates in the project workspace.
Specifically, to build the docs for `tokio-stream` the flag `--cfg
docsrs` needs to be in the environment variable `RUSTFLAGS` in addition
to being in `RUSTDOCFLAGS`.

Additionally, there was text describing that the docs cannot be built
from the root of the workspace with a link to rust-lang/cargo#9274. That
issue has since been closed as complete and the listed commands do now
work from the root of the workspace. As such, that text has been
removed.
2022-08-24 13:33:23 +02:00
Hayden Stainsby e005b6c899 io: remove PollEvented docs reference to clear_read_ready (#4931)
The documentation for`PollEvented` had a single remaining reference to
`Registration::clear_read_ready`, which no longer exists. This change
updates the documentation to refer to `Registration::clear_readiness`
instead.
2022-08-23 08:47:59 +02:00
Clint Frederickson f5c1ff7599 chore: slight re-wording of unconstrained's module docs (#4928) 2022-08-21 14:15:18 -05:00
Noah Kennedy b67b8c1398 chore: stabilize JoinSet and AbortHandle (#4920)
Closes #4535.

This leaves the ID-related APIs unstable.
2022-08-19 17:16:11 +00:00
Linda_pp de81985762 docs: fix indent of tokio::sync::watch example code (#4922) 2022-08-18 09:12:58 -05:00
John DiSanti 4b1c4801b1 ci: upgrade to nightly-2022-07-26 and pin miri nightly (#4915) 2022-08-15 21:09:47 +00:00
weegee b3c7c9846b sync: add mpsc::Sender::max_capacity method (#4904) 2022-08-14 15:52:33 +00:00
John DiSanti d416b1d1d6 ci: upgrade nightly to nightly-2022-07-25 (#4903)
Upgrade the nightly to a version that works with all of miri,
cargo-hack, minimal-versions, and cargo-check-external-types.

This is a prerequisite for #4902.
2022-08-12 16:12:09 +00:00
Alice Ryhl 6e7a630243 docs: add changelog links to readme (#4907) 2022-08-12 15:57:53 +02:00