mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
chore: fix spelling mistakes (#4858)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
parent
94a7eaed51
commit
f3e340a35b
2
.github/workflows/stress-test.yml
vendored
2
.github/workflows/stress-test.yml
vendored
@ -12,7 +12,7 @@ env:
|
||||
rust_stable: stable
|
||||
|
||||
jobs:
|
||||
stess-test:
|
||||
stress-test:
|
||||
name: Stress Test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
|
@ -562,7 +562,7 @@ Tokio ≥1.0.0 comes with LTS guarantees:
|
||||
|
||||
The goal of these guarantees is to provide stability to the ecosystem.
|
||||
|
||||
## Mininum Supported Rust Version (MSRV)
|
||||
## Minimum Supported Rust Version (MSRV)
|
||||
|
||||
* All Tokio ≥1.0.0 releases will support at least a 6-month old Rust
|
||||
compiler release.
|
||||
|
@ -1,13 +1,13 @@
|
||||
## Report a security issue
|
||||
|
||||
The Tokio project team welcomes security reports and is committed to providing prompt attention to security issues. Security issues should be reported privately via [security@tokio.rs](mailto:security@tokio.rs). Security issues should not be reported via the public Github Issue tracker.
|
||||
The Tokio project team welcomes security reports and is committed to providing prompt attention to security issues. Security issues should be reported privately via [security@tokio.rs](mailto:security@tokio.rs). Security issues should not be reported via the public GitHub Issue tracker.
|
||||
|
||||
## Vulnerability coordination
|
||||
|
||||
Remediation of security vulnerabilities is prioritized by the project team. The project team coordinates remediation with third-party project stakeholders via [Github Security Advisories](https://help.github.com/en/github/managing-security-vulnerabilities/about-github-security-advisories). Third-party stakeholders may include the reporter of the issue, affected direct or indirect users of Tokio, and maintainers of upstream dependencies if applicable.
|
||||
Remediation of security vulnerabilities is prioritized by the project team. The project team coordinates remediation with third-party project stakeholders via [GitHub Security Advisories](https://help.github.com/en/github/managing-security-vulnerabilities/about-github-security-advisories). Third-party stakeholders may include the reporter of the issue, affected direct or indirect users of Tokio, and maintainers of upstream dependencies if applicable.
|
||||
|
||||
Downstream project maintainers and Tokio users can request participation in coordination of applicable security issues by sending your contact email address, Github username(s) and any other salient information to [security@tokio.rs](mailto:security@tokio.rs). Participation in security issue coordination processes is at the discretion of the Tokio team.
|
||||
Downstream project maintainers and Tokio users can request participation in coordination of applicable security issues by sending your contact email address, GitHub username(s) and any other salient information to [security@tokio.rs](mailto:security@tokio.rs). Participation in security issue coordination processes is at the discretion of the Tokio team.
|
||||
|
||||
## Security advisories
|
||||
|
||||
The project team is committed to transparency in the security issue disclosure process. The Tokio team announces security issues via [project Github Release notes](https://github.com/tokio-rs/tokio/releases) and the [RustSec advisory database](https://github.com/RustSec/advisory-db) (i.e. `cargo-audit`).
|
||||
The project team is committed to transparency in the security issue disclosure process. The Tokio team announces security issues via [project GitHub Release notes](https://github.com/tokio-rs/tokio/releases) and the [RustSec advisory database](https://github.com/RustSec/advisory-db) (i.e. `cargo-audit`).
|
||||
|
@ -260,7 +260,7 @@ macro_rules! assert_err {
|
||||
}};
|
||||
}
|
||||
|
||||
/// Asserts that an exact duration has elapsed since since the start instant ±1ms.
|
||||
/// Asserts that an exact duration has elapsed since the start instant ±1ms.
|
||||
///
|
||||
/// ```rust
|
||||
/// use tokio::time::{self, Instant};
|
||||
|
@ -200,7 +200,7 @@ where
|
||||
/// `parent` MUST have been a parent of the node when they both got locked,
|
||||
/// otherwise there is a potential for a deadlock as invariant #2 would be violated.
|
||||
///
|
||||
/// To aquire the locks for node and parent, use [with_locked_node_and_parent].
|
||||
/// To acquire the locks for node and parent, use [with_locked_node_and_parent].
|
||||
fn move_children_to_parent(node: &mut Inner, parent: &mut Inner) {
|
||||
// Pre-allocate in the parent, for performance
|
||||
parent.children.reserve(node.children.len());
|
||||
@ -218,7 +218,7 @@ fn move_children_to_parent(node: &mut Inner, parent: &mut Inner) {
|
||||
/// Removes a child from the parent.
|
||||
///
|
||||
/// `parent` MUST be the parent of `node`.
|
||||
/// To aquire the locks for node and parent, use [with_locked_node_and_parent].
|
||||
/// To acquire the locks for node and parent, use [with_locked_node_and_parent].
|
||||
fn remove_child(parent: &mut Inner, mut node: MutexGuard<'_, Inner>) {
|
||||
// Query the position from where to remove a node
|
||||
let pos = node.parent_idx;
|
||||
|
@ -80,7 +80,7 @@ fn drop_token_no_child() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn drop_token_with_childs() {
|
||||
fn drop_token_with_children() {
|
||||
loom::model(|| {
|
||||
let token1 = CancellationToken::new();
|
||||
let child_token1 = token1.child_token();
|
||||
|
@ -190,7 +190,7 @@ impl<T> SlabStorage<T> {
|
||||
let key_contained = self.key_map.contains_key(&key.into());
|
||||
|
||||
if key_contained {
|
||||
// It's possible that a `compact` call creates capacitiy in `self.inner` in
|
||||
// It's possible that a `compact` call creates capacity in `self.inner` in
|
||||
// such a way that a `self.inner.insert` call creates a `key` which was
|
||||
// previously given out during an `insert` call prior to the `compact` call.
|
||||
// If `key` is contained in `self.key_map`, we have encountered this exact situation,
|
||||
|
@ -130,7 +130,7 @@ fn write_hits_backpressure() {
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
// Push a new new chunk
|
||||
// Push a new chunk
|
||||
mock.calls.push_back(Ok(b[..].to_vec()));
|
||||
}
|
||||
// 1 'wouldblock', 4 * 2KB buffers, 1 b-byte buffer
|
||||
|
@ -258,7 +258,7 @@ fn cancel_only_all_descendants() {
|
||||
let child2_token = token.child_token();
|
||||
let grandchild_token = child1_token.child_token();
|
||||
let grandchild2_token = child1_token.child_token();
|
||||
let grandgrandchild_token = grandchild_token.child_token();
|
||||
let great_grandchild_token = grandchild_token.child_token();
|
||||
|
||||
assert!(!parent_token.is_cancelled());
|
||||
assert!(!token.is_cancelled());
|
||||
@ -267,7 +267,7 @@ fn cancel_only_all_descendants() {
|
||||
assert!(!child2_token.is_cancelled());
|
||||
assert!(!grandchild_token.is_cancelled());
|
||||
assert!(!grandchild2_token.is_cancelled());
|
||||
assert!(!grandgrandchild_token.is_cancelled());
|
||||
assert!(!great_grandchild_token.is_cancelled());
|
||||
|
||||
let parent_fut = parent_token.cancelled();
|
||||
let fut = token.cancelled();
|
||||
@ -276,7 +276,7 @@ fn cancel_only_all_descendants() {
|
||||
let child2_fut = child2_token.cancelled();
|
||||
let grandchild_fut = grandchild_token.cancelled();
|
||||
let grandchild2_fut = grandchild2_token.cancelled();
|
||||
let grandgrandchild_fut = grandgrandchild_token.cancelled();
|
||||
let great_grandchild_fut = great_grandchild_token.cancelled();
|
||||
|
||||
pin!(parent_fut);
|
||||
pin!(fut);
|
||||
@ -285,7 +285,7 @@ fn cancel_only_all_descendants() {
|
||||
pin!(child2_fut);
|
||||
pin!(grandchild_fut);
|
||||
pin!(grandchild2_fut);
|
||||
pin!(grandgrandchild_fut);
|
||||
pin!(great_grandchild_fut);
|
||||
|
||||
assert_eq!(
|
||||
Poll::Pending,
|
||||
@ -321,7 +321,7 @@ fn cancel_only_all_descendants() {
|
||||
);
|
||||
assert_eq!(
|
||||
Poll::Pending,
|
||||
grandgrandchild_fut
|
||||
great_grandchild_fut
|
||||
.as_mut()
|
||||
.poll(&mut Context::from_waker(&waker))
|
||||
);
|
||||
@ -339,7 +339,7 @@ fn cancel_only_all_descendants() {
|
||||
assert!(child2_token.is_cancelled());
|
||||
assert!(grandchild_token.is_cancelled());
|
||||
assert!(grandchild2_token.is_cancelled());
|
||||
assert!(grandgrandchild_token.is_cancelled());
|
||||
assert!(great_grandchild_token.is_cancelled());
|
||||
|
||||
assert_eq!(
|
||||
Poll::Ready(()),
|
||||
@ -367,7 +367,7 @@ fn cancel_only_all_descendants() {
|
||||
);
|
||||
assert_eq!(
|
||||
Poll::Ready(()),
|
||||
grandgrandchild_fut
|
||||
great_grandchild_fut
|
||||
.as_mut()
|
||||
.poll(&mut Context::from_waker(&waker))
|
||||
);
|
||||
|
@ -188,9 +188,9 @@ readiness, the driver's tick is packed into the atomic `usize`.
|
||||
The `ScheduledIo` readiness `AtomicUsize` is structured as:
|
||||
|
||||
```
|
||||
| reserved | generation | driver tick | readinesss |
|
||||
|----------+------------+--------------+------------|
|
||||
| 1 bit | 7 bits + 8 bits + 16 bits |
|
||||
| reserved | generation | driver tick | readiness |
|
||||
|----------+------------+--------------+-----------|
|
||||
| 1 bit | 7 bits + 8 bits + 16 bits |
|
||||
```
|
||||
|
||||
The `reserved` and `generation` components exist today.
|
||||
|
@ -215,7 +215,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bugeting() {
|
||||
fn budgeting() {
|
||||
use futures::future::poll_fn;
|
||||
use tokio_test::*;
|
||||
|
||||
|
@ -738,7 +738,7 @@ impl Builder {
|
||||
/// * `UnhandledPanic::ShutdownRuntime` will force the runtime to
|
||||
/// shutdown immediately when a spawned task panics even if that
|
||||
/// task's `JoinHandle` has not been dropped. All other spawned tasks
|
||||
/// will immediatetly terminate and further calls to
|
||||
/// will immediately terminate and further calls to
|
||||
/// [`Runtime::block_on`] will panic.
|
||||
///
|
||||
/// # Unstable
|
||||
|
@ -131,7 +131,7 @@ impl RuntimeMetrics {
|
||||
///
|
||||
/// `worker` is the index of the worker being queried. The given value must
|
||||
/// be between 0 and `num_workers()`. The index uniquely identifies a single
|
||||
/// worker and will continue to indentify the worker throughout the lifetime
|
||||
/// worker and will continue to identify the worker throughout the lifetime
|
||||
/// of the runtime instance.
|
||||
///
|
||||
/// # Panics
|
||||
|
@ -369,7 +369,7 @@ cfg_rt_multi_thread! {
|
||||
}
|
||||
|
||||
impl<S: Schedule> Task<S> {
|
||||
/// Pre-emptively cancels the task as part of the shutdown process.
|
||||
/// Preemptively cancels the task as part of the shutdown process.
|
||||
pub(crate) fn shutdown(self) {
|
||||
let raw = self.raw;
|
||||
mem::forget(self);
|
||||
|
@ -13,7 +13,7 @@ pub(super) struct WakerRef<'a, S: 'static> {
|
||||
_p: PhantomData<(&'a Header, S)>,
|
||||
}
|
||||
|
||||
/// Returns a `WakerRef` which avoids having to pre-emptively increase the
|
||||
/// Returns a `WakerRef` which avoids having to preemptively increase the
|
||||
/// refcount if there is no need to do so.
|
||||
pub(super) fn waker_ref<T, S>(header: &NonNull<Header>) -> WakerRef<'_, S>
|
||||
where
|
||||
|
@ -665,7 +665,7 @@ impl<T> Sender<T> {
|
||||
///
|
||||
/// The `modify` closure must return `true` if the value has actually
|
||||
/// been modified during the mutable borrow. It should only return `false`
|
||||
/// if the value is guaranteed to be unnmodified despite the mutable
|
||||
/// if the value is guaranteed to be unmodified despite the mutable
|
||||
/// borrow.
|
||||
///
|
||||
/// Receivers are only notified if the closure returned `true`. If the
|
||||
|
@ -4,7 +4,7 @@ use std::task::Poll;
|
||||
/// runtime *if* the task's coop budget was exhausted.
|
||||
///
|
||||
/// The task will only yield if its entire coop budget has been exhausted.
|
||||
/// This function can can be used in order to insert optional yield points into long
|
||||
/// This function can be used in order to insert optional yield points into long
|
||||
/// computations that do not use Tokio resources like sockets or semaphores,
|
||||
/// without redundantly yielding to the runtime each time.
|
||||
///
|
||||
|
@ -160,7 +160,7 @@ cfg_rt! {
|
||||
/// tokio::task::spawn_local(run_task(new_task));
|
||||
/// }
|
||||
/// // If the while loop returns, then all the LocalSpawner
|
||||
/// // objects have have been dropped.
|
||||
/// // objects have been dropped.
|
||||
/// });
|
||||
///
|
||||
/// // This will return once all senders are dropped and all
|
||||
@ -652,7 +652,7 @@ cfg_unstable! {
|
||||
/// * `UnhandledPanic::ShutdownRuntime` will force the `LocalSet` to
|
||||
/// shutdown immediately when a spawned task panics even if that
|
||||
/// task's `JoinHandle` has not been dropped. All other spawned tasks
|
||||
/// will immediatetly terminate and further calls to
|
||||
/// will immediately terminate and further calls to
|
||||
/// [`LocalSet::block_on`] and [`LocalSet::run_until`] will panic.
|
||||
///
|
||||
/// # Panics
|
||||
|
@ -36,7 +36,7 @@
|
||||
//! point than it was originally scheduled for.
|
||||
//!
|
||||
//! This is accomplished by lazily rescheduling timers. That is, we update the
|
||||
//! state field field with the true expiration of the timer from the holder of
|
||||
//! state field with the true expiration of the timer from the holder of
|
||||
//! the [`TimerEntry`]. When the driver services timers (ie, whenever it's
|
||||
//! walking lists of timers), it checks this "true when" value, and reschedules
|
||||
//! based on it.
|
||||
|
@ -291,11 +291,11 @@ fn balanced_incr_and_decr() {
|
||||
let incr_inner = inner.clone();
|
||||
let decr_inner = inner.clone();
|
||||
|
||||
let incr_hndle = thread::spawn(move || incr(incr_inner));
|
||||
let decr_hndle = thread::spawn(move || decr(decr_inner));
|
||||
let incr_handle = thread::spawn(move || incr(incr_inner));
|
||||
let decr_handle = thread::spawn(move || decr(decr_inner));
|
||||
|
||||
incr_hndle.join().expect("should never fail");
|
||||
decr_hndle.join().expect("should never fail");
|
||||
incr_handle.join().expect("should never fail");
|
||||
decr_handle.join().expect("should never fail");
|
||||
|
||||
assert_eq!(inner.num(Ordering::SeqCst), 0);
|
||||
})
|
||||
|
@ -278,7 +278,7 @@ pub enum MissedTickBehavior {
|
||||
/// // 50ms after the call to `tick` up above. That is, in `tick`, when we
|
||||
/// // recognize that we missed a tick, we schedule the next tick to happen
|
||||
/// // 50ms (or whatever the `period` is) from right then, not from when
|
||||
/// // were were *supposed* to tick
|
||||
/// // were *supposed* to tick
|
||||
/// interval.tick().await;
|
||||
/// # }
|
||||
/// ```
|
||||
|
@ -86,7 +86,7 @@ async fn non_cooperative_task(permits: Arc<Semaphore>) -> usize {
|
||||
let mut exceeded_budget = 0;
|
||||
|
||||
for _ in 0..5 {
|
||||
// Another task should run after after this task uses its whole budget
|
||||
// Another task should run after this task uses its whole budget
|
||||
for _ in 0..128 {
|
||||
let _permit = permits.clone().acquire_owned().await.unwrap();
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ async fn non_cooperative_task(permits: Arc<Semaphore>) -> Result<usize, String>
|
||||
let mut exceeded_budget = 0;
|
||||
|
||||
for _ in 0..5 {
|
||||
// Another task should run after after this task uses its whole budget
|
||||
// Another task should run after this task uses its whole budget
|
||||
for _ in 0..128 {
|
||||
let _permit = permits.clone().acquire_owned().await.unwrap();
|
||||
}
|
||||
|
@ -1137,7 +1137,7 @@ rt_test! {
|
||||
let (spawned_tx, mut spawned_rx) = mpsc::unbounded_channel();
|
||||
|
||||
let mut tasks = vec![];
|
||||
// Spawn a bunch of tasks that ping ping between each other to
|
||||
// Spawn a bunch of tasks that ping-pong between each other to
|
||||
// saturate the runtime.
|
||||
for _ in 0..NUM {
|
||||
let (tx1, mut rx1) = mpsc::unbounded_channel();
|
||||
|
@ -65,7 +65,7 @@ fn forget() {
|
||||
|
||||
#[tokio::test]
|
||||
#[cfg(feature = "full")]
|
||||
async fn stresstest() {
|
||||
async fn stress_test() {
|
||||
let sem = Arc::new(Semaphore::new(5));
|
||||
let mut join_handles = Vec::new();
|
||||
for _ in 0..1000 {
|
||||
|
@ -91,7 +91,7 @@ fn forget() {
|
||||
|
||||
#[tokio::test]
|
||||
#[cfg(feature = "full")]
|
||||
async fn stresstest() {
|
||||
async fn stress_test() {
|
||||
let sem = Arc::new(Semaphore::new(5));
|
||||
let mut join_handles = Vec::new();
|
||||
for _ in 0..1000 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user