diff options
28 files changed, 46 insertions, 46 deletions
@@ -21,7 +21,7 @@ race:crossbeam_epoch race:crossbeam_deque*push race:crossbeam_deque*steal -# This filters out expected data race in the treiber stack implementations. +# This filters out expected data race in the Treiber stack implementations. # Treiber stacks are inherently racy. The pop operation will attempt to access # the "next" pointer on the node it is attempting to pop. However, at this # point it has not gained ownership of the node and another thread might beat diff --git a/examples/echo-udp.rs b/examples/echo-udp.rs index 9a1b9684..89cc3d16 100644 --- a/examples/echo-udp.rs +++ b/examples/echo-udp.rs @@ -1,6 +1,6 @@ //! An UDP echo server that just sends back everything that it receives. //! -//! If you're on unix you can test this out by in one terminal executing: +//! If you're on Unix you can test this out by in one terminal executing: //! //! cargo run --example echo-udp //! diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index 2e5b344d..c23d8dd1 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -345,7 +345,7 @@ impl Runtime { /// complete, and yielding its resolved result. Any tasks or timers which /// the future spawns internally will be executed on the runtime. /// - /// This method should not be called from an asynchrounous context. + /// This method should not be called from an asynchronous context. /// /// # Panics /// @@ -370,7 +370,7 @@ impl Runtime { /// its resolved result. Any tasks or timers which the future spawns /// internally will be executed on the runtime and waited for completion. /// - /// This method should not be called from an asynchrounous context. + /// This method should not be called from an asynchronous context. /// /// # Panics /// diff --git a/src/timer.rs b/src/timer.rs index 04abf2e5..fc85a2a7 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -10,9 +10,9 @@ //! is initialized with a `Duration` and repeatedly yields each time the //! duration elapses. //! -//! * [`Timeout`][Timeeout]: Wraps a future or stream, setting an upper bound to the +//! * [`Timeout`][Timeout]: Wraps a future or stream, setting an upper bound to the //! amount of time it is allowed to execute. If the future or stream does not -//! completee in time, then it is canceled and an error is returned. +//! complete in time, then it is canceled and an error is returned. //! //! * [`DelayQueue`]: A queue where items are returned once the requested delay //! has expired. diff --git a/tokio-current-thread/src/scheduler.rs b/tokio-current-thread/src/scheduler.rs index c82b9d12..de65cc03 100644 --- a/tokio-current-thread/src/scheduler.rs +++ b/tokio-current-thread/src/scheduler.rs @@ -73,7 +73,7 @@ struct Inner<U> { head_readiness: AtomicPtr<Node<U>>, tail_readiness: UnsafeCell<*const Node<U>>, - // Used as part of the MPSC queue algorithm + // Used as part of the mpsc queue algorithm stub: Arc<Node<U>>, } @@ -242,7 +242,7 @@ where U: Unpark, // being released, another thread notified it, which // resulted in it getting pushed into the mpsc channel. // - // In this case, we just dec the ref count. + // In this case, we just decrement the ref count. let node = ptr2arc(node); assert!((*node.next_all.get()).is_null()); assert!((*node.prev_all.get()).is_null()); diff --git a/tokio-current-thread/tests/current_thread.rs b/tokio-current-thread/tests/current_thread.rs index d40cf6f4..598587fd 100644 --- a/tokio-current-thread/tests/current_thread.rs +++ b/tokio-current-thread/tests/current_thread.rs @@ -428,7 +428,7 @@ fn turn_has_polled() { } // Our own mock Park that is never really waiting and the only -// thing it does is to send, on request, something (once) to a onshot +// thing it does is to send, on request, something (once) to a oneshot // channel struct MyPark { sender: Option<oneshot::Sender<()>>, diff --git a/tokio-executor/README.md b/tokio-executor/README.md index 988a46b4..38369425 100644 --- a/tokio-executor/README.md +++ b/tokio-executor/README.md @@ -22,7 +22,7 @@ executor, including: * The [`Executor`] trait describes the API for spawning a future onto an executor. -* [`enter`] marks that the the current thread is entering an execution +* [`enter`] marks that the current thread is entering an execution context. This prevents a second executor from accidentally starting from within the context of one that is already running. diff --git a/tokio-executor/src/lib.rs b/tokio-executor/src/lib.rs index 5e1b1481..ccf22b84 100644 --- a/tokio-executor/src/lib.rs +++ b/tokio-executor/src/lib.rs @@ -20,7 +20,7 @@ //! * The [`Executor`] trait describes the API for spawning a future onto an //! executor. //! -//! * [`enter`] marks that the the current thread is entering an execution +//! * [`enter`] marks that the current thread is entering an execution //! context. This prevents a second executor from accidentally starting from //! within the context of one that is already running. //! @@ -114,7 +114,7 @@ pub trait Executor { /// /// # Panics /// - /// Implementors are encouraged to avoid panics. However, a panic is + /// Implementers are encouraged to avoid panics. However, a panic is /// permitted and the caller should check the implementation specific /// documentation for more details on possible panics. /// @@ -148,7 +148,7 @@ pub trait Executor { /// /// # Panics /// - /// This function must not panic. Implementors must ensure that panics do + /// This function must not panic. Implementers must ensure that panics do /// not happen. /// /// # Examples diff --git a/tokio-io/src/_tokio_codec/decoder.rs b/tokio-io/src/_tokio_codec/decoder.rs index 9c9fbacb..edc0ecc0 100644 --- a/tokio-io/src/_tokio_codec/decoder.rs +++ b/tokio-io/src/_tokio_codec/decoder.rs @@ -1,3 +1,3 @@ -// For now, we need to keep the implmentation of Encoder in tokio_io. +// For now, we need to keep the implementation of Encoder in tokio_io. pub use codec::Decoder; diff --git a/tokio-io/src/_tokio_codec/encoder.rs b/tokio-io/src/_tokio_codec/encoder.rs index 9cbe054d..20b9e375 100644 --- a/tokio-io/src/_tokio_codec/encoder.rs +++ b/tokio-io/src/_tokio_codec/encoder.rs @@ -1,3 +1,3 @@ -// For now, we need to keep the implmentation of Encoder in tokio_io. +// For now, we need to keep the implementation of Encoder in tokio_io. pub use codec::Encoder; diff --git a/tokio-io/src/async_read.rs b/tokio-io/src/async_read.rs index 3c2c3bab..740f71c2 100644 --- a/tokio-io/src/async_read.rs +++ b/tokio-io/src/async_read.rs @@ -52,7 +52,7 @@ pub trait AsyncRead: std_io::Read { /// `prepare_uninitialized_buffer`. /// /// This function isn't actually `unsafe` to call but `unsafe` to implement. - /// The implementor must ensure that either the whole `buf` has been zeroed + /// The implementer must ensure that either the whole `buf` has been zeroed /// or `read_buf()` overwrites the buffer without reading it and returns /// correct value. /// diff --git a/tokio-io/src/async_write.rs b/tokio-io/src/async_write.rs index 514a8ec1..5553650d 100644 --- a/tokio-io/src/async_write.rs +++ b/tokio-io/src/async_write.rs @@ -82,7 +82,7 @@ pub trait AsyncWrite: std_io::Write { /// appropriate. This method is the hook for such protocols to implement the /// graceful shutdown logic. /// - /// This `shutdown` method is required by implementors of the + /// This `shutdown` method is required by implementers of the /// `AsyncWrite` trait. Wrappers typically just want to proxy this call /// through to the wrapped type, and base types will typically implement /// shutdown logic here or just return `Ok(().into())`. Note that if you're diff --git a/tokio-io/src/framed.rs b/tokio-io/src/framed.rs index 7235b1c6..b3df2501 100644 --- a/tokio-io/src/framed.rs +++ b/tokio-io/src/framed.rs @@ -99,7 +99,7 @@ impl<T, U> Framed<T, U> { /// being worked with. pub fn into_parts(self) -> FramedParts<T> { let (inner, readbuf) = self.inner.into_parts(); - let (inner, writebuf) = inner.into_parts(); + let (inner, writebuf) = inner.into_parts(); FramedParts { inner: inner.0, readbuf: readbuf, writebuf: writebuf } } diff --git a/tokio-tcp/src/stream.rs b/tokio-tcp/src/stream.rs index 02ebbea9..d062720c 100644 --- a/tokio-tcp/src/stream.rs +++ b/tokio-tcp/src/stream.rs @@ -44,7 +44,7 @@ impl TcpStream { /// /// This function will create a new TCP socket and attempt to connect it to /// the `addr` provided. The returned future will be resolved once the - /// stream has successfully connected, or it wil return an error if one + /// stream has successfully connected, or it will return an error if one /// occurs. pub fn connect(addr: &SocketAddr) -> ConnectFuture { use self::ConnectFutureState::*; diff --git a/tokio-threadpool/src/lib.rs b/tokio-threadpool/src/lib.rs index 3e233e21..aa459d54 100644 --- a/tokio-threadpool/src/lib.rs +++ b/tokio-threadpool/src/lib.rs @@ -103,7 +103,7 @@ extern crate log; // // ## Sleeping workers // -// Sleeping workers are tracked using a [treiber stack]. This results in the +// Sleeping workers are tracked using a [Treiber stack]. This results in the // thread that most recently went to sleep getting woken up first. When the pool // is not under load, this helps threads shutdown faster. // @@ -137,7 +137,7 @@ extern crate log; // Also, whenever a worker is woken up via a signal and it does find work, it, // in turn, will try to wake up a new worker. // -// [treiber stack]: https://en.wikipedia.org/wiki/Treiber_Stack +// [Treiber stack]: https://en.wikipedia.org/wiki/Treiber_Stack pub mod park; diff --git a/tokio-threadpool/src/pool/backup.rs b/tokio-threadpool/src/pool/backup.rs index 5380a32b..8ef6b695 100644 --- a/tokio-threadpool/src/pool/backup.rs +++ b/tokio-threadpool/src/pool/backup.rs @@ -40,7 +40,7 @@ pub(crate) struct Backup { /// * If the thread is running state: AtomicUsize, - /// Next entry in the treiber stack. + /// Next entry in the Treiber stack. next_sleeper: UnsafeCell<BackupId>, /// Used to put the thread to sleep diff --git a/tokio-threadpool/src/pool/backup_stack.rs b/tokio-threadpool/src/pool/backup_stack.rs index c330a036..aa69e143 100644 --- a/tokio-threadpool/src/pool/backup_stack.rs +++ b/tokio-threadpool/src/pool/backup_stack.rs @@ -22,7 +22,7 @@ pub(crate) const EMPTY: BackupId = BackupId(MAX_BACKUP); /// Used to mark the stack as terminated pub(crate) const TERMINATED: BackupId = BackupId(EMPTY.0 + 1); -/// How many bits the treiber ABA guard is offset by +/// How many bits the Treiber ABA guard is offset by const ABA_GUARD_SHIFT: usize = 16; #[cfg(target_pointer_width = "64")] @@ -165,7 +165,7 @@ impl State { fn set_head(&mut self, val: BackupId) { let val = val.0; - // The ABA guard protects against the ABA problem w/ treiber stacks + // The ABA guard protects against the ABA problem w/ Treiber stacks let aba_guard = ((self.0 >> ABA_GUARD_SHIFT) + 1) & ABA_GUARD_MASK; self.0 = (aba_guard << ABA_GUARD_SHIFT) | val; diff --git a/tokio-threadpool/src/task/blocking.rs b/tokio-threadpool/src/task/blocking.rs index 62eef5d9..cdf2ceff 100644 --- a/tokio-threadpool/src/task/blocking.rs +++ b/tokio-threadpool/src/task/blocking.rs @@ -14,7 +14,7 @@ use std::thread; /// Manages the state around entering a blocking section and tasks that are /// queued pending the ability to block. /// -/// This is a hybrid counter and instrusive mpsc channel (like `Queue`). +/// This is a hybrid counter and intrusive mpsc channel (like `Queue`). #[derive(Debug)] pub(crate) struct Blocking { /// Queue head. diff --git a/tokio-threadpool/src/worker/mod.rs b/tokio-threadpool/src/worker/mod.rs index b71dbd26..3ac7f039 100644 --- a/tokio-threadpool/src/worker/mod.rs +++ b/tokio-threadpool/src/worker/mod.rs @@ -732,7 +732,7 @@ impl Worker { } } Shutdown | Running => { - // To get here, the block above transitioned the tate to + // To get here, the block above transitioned the state to // `Sleeping`. No other thread can concurrently // transition to `Shutdown` or `Running`. unreachable!(); @@ -805,7 +805,7 @@ impl Worker { } } Shutdown | Running => { - // To get here, the block above transitioned the tate to + // To get here, the block above transitioned the state to // `Sleeping`. No other thread can concurrently // transition to `Shutdown` or `Running`. unreachable!(); diff --git a/tokio-threadpool/src/worker/stack.rs b/tokio-threadpool/src/worker/stack.rs index 19245780..b0b786ed 100644 --- a/tokio-threadpool/src/worker/stack.rs +++ b/tokio-threadpool/src/worker/stack.rs @@ -46,7 +46,7 @@ pub(crate) const EMPTY: usize = MAX_WORKERS; /// Used to mark the stack as terminated pub(crate) const TERMINATED: usize = EMPTY + 1; -/// How many bits the treiber ABA guard is offset by +/// How many bits the Treiber ABA guard is offset by const ABA_GUARD_SHIFT: usize = 16; #[cfg(target_pointer_width = "64")] @@ -215,7 +215,7 @@ impl State { #[inline] fn set_head(&mut self, val: usize) { - // The ABA guard protects against the ABA problem w/ treiber stacks + // The ABA guard protects against the ABA problem w/ Treiber stacks let aba_guard = ((self.0 >> ABA_GUARD_SHIFT) + 1) & ABA_GUARD_MASK; self.0 = (aba_guard << ABA_GUARD_SHIFT) | val; diff --git a/tokio-timer/src/atomic.rs b/tokio-timer/src/atomic.rs index 060fed51..0f74c31d 100644 --- a/tokio-timer/src/atomic.rs +++ b/tokio-timer/src/atomic.rs @@ -45,7 +45,7 @@ mod imp { mod imp { use std::sync::Mutex; use std::sync::atomic::Ordering; - + #[derive(Debug)] pub struct AtomicU64 { inner: Mutex<u64>, diff --git a/tokio-timer/src/delay_queue.rs b/tokio-timer/src/delay_queue.rs index 3f30f447..21605a91 100644 --- a/tokio-timer/src/delay_queue.rs +++ b/tokio-timer/src/delay_queue.rs @@ -198,7 +198,7 @@ struct Data<T> { /// Next entry in the stack next: Option<usize>, - /// Previous entry in the stac + /// Previous entry in the stack prev: Option<usize>, } @@ -231,7 +231,7 @@ impl<T> DelayQueue<T> { /// use tokio_timer::timer::Handle; /// /// let handle = Handle::default(); - /// let deplay_queue: DelayQueue<u32> = DelayQueue::with_capacity_and_handle(0, &handle); + /// let delay_queue: DelayQueue<u32> = DelayQueue::with_capacity_and_handle(0, &handle); /// ``` pub fn with_capacity_and_handle(capacity: usize, handle: &Handle) -> DelayQueue<T> { DelayQueue { @@ -282,7 +282,7 @@ impl<T> DelayQueue<T> { /// /// The return value represents the insertion and is used at an argument to /// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once - /// `value` is removed from the queue eitheer by calling [`poll`] after + /// `value` is removed from the queue either by calling [`poll`] after /// `when` is reached or by calling [`remove`]. At this point, the caller /// must take care to not use the returned [`Key`] again as it may reference /// a different item in the queue. @@ -350,7 +350,7 @@ impl<T> DelayQueue<T> { /// /// The return value represents the insertion and is used at an argument to /// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once - /// `value` is removed from the queue eitheer by calling [`poll`] after + /// `value` is removed from the queue either by calling [`poll`] after /// `when` is reached or by calling [`remove`]. At this point, the caller /// must take care to not use the returned [`Key`] again as it may reference /// a different item in the queue. @@ -485,7 +485,7 @@ impl<T> DelayQueue<T> { /// /// delay_queue.reset_at(&key, Instant::now() + Duration::from_secs(10)); /// - /// // "foo"is now scheduledto be returned in 10 seconds + /// // "foo"is now scheduled to be returned in 10 seconds /// # } /// ``` pub fn reset_at(&mut self, key: &Key, when: Instant) { @@ -541,7 +541,7 @@ impl<T> DelayQueue<T> { /// /// delay_queue.reset(&key, Duration::from_secs(10)); /// - /// // "foo"is now scheduledto be returned in 10 seconds + /// // "foo"is now scheduled to be returned in 10 seconds /// # } /// ``` pub fn reset(&mut self, key: &Key, timeout: Duration) { diff --git a/tokio-timer/src/lib.rs b/tokio-timer/src/lib.rs index a467e32a..c629aac6 100644 --- a/tokio-timer/src/lib.rs +++ b/tokio-timer/src/lib.rs @@ -11,7 +11,7 @@ //! //! * [`Timeout`]: Wraps a future or stream, setting an upper bound to the //! amount of time it is allowed to execute. If the future or stream does not -//! completee in time, then it is canceled and an error is returned. +//! complete in time, then it is canceled and an error is returned. //! //! * [`DelayQueue`]: A queue where items are returned once the requested delay //! has expired. diff --git a/tokio-timer/src/wheel/mod.rs b/tokio-timer/src/wheel/mod.rs index e9085523..ed7dba8a 100644 --- a/tokio-timer/src/wheel/mod.rs +++ b/tokio-timer/src/wheel/mod.rs @@ -84,7 +84,7 @@ where /// /// # Arguments /// - /// * `when`: is the instant at which the the entry should be fired. It is + /// * `when`: is the instant at which the entry should be fired. It is /// represented as the number of milliseconds since the creation /// of the timing wheel. /// @@ -98,9 +98,9 @@ where /// /// `Err(Elapsed)` indicates that `when` represents an instant that has /// already passed. In this case, the caller should fire the timeout - /// immediateely. + /// immediately. /// - /// `Err(Invalid)` indicates an invalid `when` argumeent as been supplied. + /// `Err(Invalid)` indicates an invalid `when` argument as been supplied. pub fn insert(&mut self, when: u64, item: T::Owned, store: &mut T::Store) -> Result<(), (T::Owned, InsertError)> { diff --git a/tokio-tls/README.md b/tokio-tls/README.md index b2c06559..25cefaf5 100644 --- a/tokio-tls/README.md +++ b/tokio-tls/README.md @@ -26,7 +26,7 @@ extern crate tokio_tls; use tokio_tls::{TlsConnector, TlsAcceptor}; ``` -You can find few examples how to use this crate in examples directory (using TLS in +You can find few examples how to use this crate in examples directory (using TLS in hyper server or client). By default the `native-tls` crate currently uses the "platform appropriate" diff --git a/tokio-uds/src/datagram.rs b/tokio-uds/src/datagram.rs index e34c9940..b68444da 100644 --- a/tokio-uds/src/datagram.rs +++ b/tokio-uds/src/datagram.rs @@ -30,7 +30,7 @@ impl UnixDatagram { /// Creates an unnamed pair of connected sockets. /// - /// This function will create a pair of interconnected unix sockets for + /// This function will create a pair of interconnected Unix sockets for /// communicating back and forth between one another. Each socket will be /// associated with the event loop whose handle is also provided. pub fn pair() -> io::Result<(UnixDatagram, UnixDatagram)> { diff --git a/tokio-uds/src/listener.rs b/tokio-uds/src/listener.rs index ec873185..c63b4a84 100644 --- a/tokio-uds/src/listener.rs +++ b/tokio-uds/src/listener.rs @@ -12,7 +12,7 @@ use std::os::unix::io::{AsRawFd, RawFd}; use std::os::unix::net::{self, SocketAddr}; use std::path::Path; -/// A Unix socket which can accept connections from other unix sockets. +/// A Unix socket which can accept connections from other Unix sockets. pub struct UnixListener { io: PollEvented<mio_uds::UnixListener>, } diff --git a/tokio-uds/src/stream.rs b/tokio-uds/src/stream.rs index 2e0a6822..50dfc099 100644 --- a/tokio-uds/src/stream.rs +++ b/tokio-uds/src/stream.rs @@ -17,7 +17,7 @@ use std::os::unix::io::{AsRawFd, RawFd}; use std::os::unix::net::{self, SocketAddr}; use std::path::Path; -/// A structure representing a connected unix socket. +/// A structure representing a connected Unix socket. /// /// This socket can be connected directly with `UnixStream::connect` or accepted /// from a listener with `UnixListener::incoming`. Additionally, a pair of @@ -43,7 +43,7 @@ enum State { impl UnixStream { /// Connects to the socket named by `path`. /// - /// This function will create a new unix socket and connect to the path + /// This function will create a new Unix socket and connect to the path /// specified, associating the returned stream with the default event loop's /// handle. pub fn connect<P>(path: P) -> ConnectFuture @@ -75,7 +75,7 @@ impl UnixStream { /// Creates an unnamed pair of connected sockets. /// - /// This function will create a pair of interconnected unix sockets for + /// This function will create a pair of interconnected Unix sockets for /// communicating back and forth between one another. Each socket will be /// associated with the event loop whose handle is also provided. pub fn pair() -> io::Result<(UnixStream, UnixStream)> { |