| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| |
|
|
|
| |
This will let us call _inner from blocking_io, with a different
precondition. No functional change.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This is going to become a hazard. Let's be explicit.
This means using educe to derive the Default for Data.
We also need to update our educe dependency to 0.4.22, since that's
when Default(expression= "...") started working correctly.
|
| |
|
|
|
|
|
|
| |
execute_until_first_stall is now simply a wrapper which does some
logging. It will do a bit more in a moment.
Giving the inner function a more obvious name is helpful, since the
executor main loop is a thing one is often looking for.
|
| |
|
|
| |
rustfmt.
|
| |
|
|
|
|
|
|
| |
Introduce ToplevelRuntime as an alias, and use it in the top-level
programs.
Now none of the principal protocol implementation code has access to
the executor's toplevel entrypoint, and can't call it by mistake.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forbid re-entering the executor using ToplevelBlockOn::block_on.
This was always forbidden in the case of MockExecutor, but that meant
that tests using MockExecutor would malfunction if the code under test
needed to re-enter the executor from sync code (since the code under test
would have to use block_on, which wrong). See #1835.
Provide a function which *can* do this, reenter_block_on. The
MockExecutor needs to know the difference, and other runtimes may too.
They are conceptually quite different operations.
Introduce ToplevelRuntime as a convenience alias.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Document the new plan for blocking interaction in the trait-level
docs for the Blocking trait (used to be SpawnBlocking).
Add cross-references (in some cases to not-yet-existing pieces).
* Rename: spawn_blocking to spawn_thread. We're going to distinguish
thread-creation (relatively expensive) from brief entry to sync code
(relatively cheap, but more restricted).
* Rename the SpawnBlocking trait to Blocking, and its ThreadHandle
to ThreadHandle. This trait is going to gain more functionality.
* Add the missing mention of `Blocking` to the docs for `Runtime`.
|
| |
|
|
|
|
|
|
|
|
| |
We're going to distinguish top-level runtime entry, from *re*-entry to
an existing executor. It is most convenient to rename this trait
first. Documentation of the distinction will come later.
(We're going to retain the function name `block_on`, but we want the trait
to be more obviously a top-level only thing, though, so we give it a
name that will hopefully avoid it peroulating throughout the codebase..)
|
| |
|
|
| |
The MockExecutor doesn't have a threadpool.
|
| | |
|
| | |
|
| |
|
|
|
| |
This makes it clearer that this is a specific term, which a
definition.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2793#note_3161972
|
| |
|
|
|
| |
The rustdocs for a fn in a trait impl are rendered, but are very
unobvious. Put the information in the top-level documentation.
|
| |
|
|
| |
We'll expose this with some new traits in tor_rtmock.
|
| | |
|
| |
|
|
|
|
|
| |
No change to output, but much less open-coding.
Move the doc comment that was on the Debugg impl, to the `DebugTasks`
helper struct.
|
| |
|
|
| |
Show where each test sub-case is started, in stderr output.
|
| |
|
|
| |
We're going to add another call site.
|
| |
|
|
| |
We're going to add another call site.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We're going to want to add a field inside the Arc but not inside the
Mutex, so make the Arc contents into a named-fields struct.
We don't need ArcMutexData any more. Arc<Shared> will do fine.
Previously, we needed to implement .lock() on ArcMutexData but because
Arc<Shared> derefs to Shared, we can implement it on Shared just as
well.
The field in MockExecutor ought to be renamed, but that's textually
intrusive so will come in the next commit.
|
| |
|
|
|
| |
In an earlier version of this code there was a Polling state, but
there isn't now.
|
| | |
|
| |
|
|
|
| |
This renames UnsupportedStreamOpsHandle to NoOpStreamOpsHandle for
clarity (the old name kind of sounded like the name of an error type).
|
| | |
|
| |
|
|
|
| |
We're about to add a trait bound that forces `MockTlsStream` to impl
`StreamOps`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously, if r is Pending, `fut` is moved out of (stored in
`task.fut`), whereas if r is Ready, it is retained and then dropped at
the end of the loop iteration. This is quite subtle, and involves
`fut` being in a "maybe moved out of" state (which cannot be
represented in Rust's surface type system) after the block with the
`data` lock.
Let's write code that more clearly ensures that the compiler DTRT.
|
| |
|
|
|
| |
This passes right now, but only because the lifetime of the `fut`
variable in `execute_until_first_stall` happens to be right.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Due to the limitations on RPIT, it's better to use a GAT for now.
|
| | |
|
| |
|
|
|
| |
This adds a new SpawnBlocking trait, which exposes the spawn_blocking
function that tokio, async-std, and other runtimes have.
|
| |\
| |
| |
| |
| | |
clippy: deny `mod_module_files`
See merge request tpo/core/arti!2689
|
| | |
| |
| |
| |
| |
| | |
Denies 'mod.rs' files for consistency.
https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
|
| |/ |
|
| | |
|
| | |
|
| |
|
|
| |
Part of #1769
|
| |
|
|
|
|
|
|
| |
In 1.83, this warning triggers on many of our crates.
We're thinking of fixing them all, but for now,
we're going to disable the warning.
This is part of #1765.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2502#note_3090557
|
| |
|
|
|
|
| |
Discussion here
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2502#note_3090554
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2502#note_3090556
|