pluralize doc comment verbs and add missing periods
This commit is contained in:
@@ -215,7 +215,7 @@ pub struct Builder {
|
||||
}
|
||||
|
||||
impl Builder {
|
||||
/// Generate the base configuration for spawning a thread, from which
|
||||
/// Generates the base configuration for spawning a thread, from which
|
||||
/// configuration methods can be chained.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn new() -> Builder {
|
||||
@@ -225,7 +225,7 @@ impl Builder {
|
||||
}
|
||||
}
|
||||
|
||||
/// Name the thread-to-be. Currently the name is used for identification
|
||||
/// Names the thread-to-be. Currently the name is used for identification
|
||||
/// only in panic messages.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn name(mut self, name: String) -> Builder {
|
||||
@@ -233,14 +233,14 @@ impl Builder {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the size of the stack for the new thread.
|
||||
/// Sets the size of the stack for the new thread.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn stack_size(mut self, size: usize) -> Builder {
|
||||
self.stack_size = Some(size);
|
||||
self
|
||||
}
|
||||
|
||||
/// Spawn a new thread, and return a join handle for it.
|
||||
/// Spawns a new thread, and returns a join handle for it.
|
||||
///
|
||||
/// The child thread may outlive the parent (unless the parent thread
|
||||
/// is the main thread; the whole process is terminated when the main
|
||||
@@ -259,8 +259,8 @@ impl Builder {
|
||||
self.spawn_inner(Box::new(f)).map(|i| JoinHandle(i))
|
||||
}
|
||||
|
||||
/// Spawn a new child thread that must be joined within a given
|
||||
/// scope, and return a `JoinGuard`.
|
||||
/// Spawns a new child thread that must be joined within a given
|
||||
/// scope, and returns a `JoinGuard`.
|
||||
///
|
||||
/// The join guard can be used to explicitly join the child thread (via
|
||||
/// `join`), returning `Result<T>`, or it will implicitly join the child
|
||||
@@ -355,7 +355,7 @@ impl Builder {
|
||||
// Free functions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Spawn a new thread, returning a `JoinHandle` for it.
|
||||
/// Spawns a new thread, returning a `JoinHandle` for it.
|
||||
///
|
||||
/// The join handle will implicitly *detach* the child thread upon being
|
||||
/// dropped. In this case, the child thread may outlive the parent (unless
|
||||
@@ -374,7 +374,7 @@ pub fn spawn<F>(f: F) -> JoinHandle where F: FnOnce(), F: Send + 'static {
|
||||
Builder::new().spawn(f).unwrap()
|
||||
}
|
||||
|
||||
/// Spawn a new *scoped* thread, returning a `JoinGuard` for it.
|
||||
/// Spawns a new *scoped* thread, returning a `JoinGuard` for it.
|
||||
///
|
||||
/// The join guard can be used to explicitly join the child thread (via
|
||||
/// `join`), returning `Result<T>`, or it will implicitly join the child
|
||||
@@ -400,7 +400,7 @@ pub fn current() -> Thread {
|
||||
thread_info::current_thread()
|
||||
}
|
||||
|
||||
/// Cooperatively give up a timeslice to the OS scheduler.
|
||||
/// Cooperatively gives up a timeslice to the OS scheduler.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn yield_now() {
|
||||
unsafe { imp::yield_now() }
|
||||
@@ -413,7 +413,7 @@ pub fn panicking() -> bool {
|
||||
unwind::panicking()
|
||||
}
|
||||
|
||||
/// Invoke a closure, capturing the cause of panic if one occurs.
|
||||
/// Invokes a closure, capturing the cause of panic if one occurs.
|
||||
///
|
||||
/// This function will return `Ok(())` if the closure does not panic, and will
|
||||
/// return `Err(cause)` if the closure panics. The `cause` returned is the
|
||||
@@ -462,7 +462,7 @@ pub fn catch_panic<F, R>(f: F) -> Result<R>
|
||||
Ok(result.unwrap())
|
||||
}
|
||||
|
||||
/// Put the current thread to sleep for the specified amount of time.
|
||||
/// Puts the current thread to sleep for the specified amount of time.
|
||||
///
|
||||
/// The thread may sleep longer than the duration specified due to scheduling
|
||||
/// specifics or platform-dependent functionality. Note that on unix platforms
|
||||
@@ -482,7 +482,7 @@ pub fn sleep(dur: Duration) {
|
||||
imp::sleep(dur)
|
||||
}
|
||||
|
||||
/// Block unless or until the current thread's token is made available (may wake spuriously).
|
||||
/// Blocks unless or until the current thread's token is made available (may wake spuriously).
|
||||
///
|
||||
/// See the module doc for more detail.
|
||||
//
|
||||
@@ -501,7 +501,7 @@ pub fn park() {
|
||||
*guard = false;
|
||||
}
|
||||
|
||||
/// Block unless or until the current thread's token is made available or
|
||||
/// Blocks unless or until the current thread's token is made available or
|
||||
/// the specified duration has been reached (may wake spuriously).
|
||||
///
|
||||
/// The semantics of this function are equivalent to `park()` except that the
|
||||
@@ -573,7 +573,7 @@ impl Thread {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the thread's name.
|
||||
/// Gets the thread's name.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn name(&self) -> Option<&str> {
|
||||
self.inner.name.as_ref().map(|s| &**s)
|
||||
@@ -638,13 +638,13 @@ impl<T> JoinInner<T> {
|
||||
pub struct JoinHandle(JoinInner<()>);
|
||||
|
||||
impl JoinHandle {
|
||||
/// Extract a handle to the underlying thread
|
||||
/// Extracts a handle to the underlying thread
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn thread(&self) -> &Thread {
|
||||
&self.0.thread
|
||||
}
|
||||
|
||||
/// Wait for the associated thread to finish.
|
||||
/// Waits for the associated thread to finish.
|
||||
///
|
||||
/// If the child thread panics, `Err` is returned with the parameter given
|
||||
/// to `panic`.
|
||||
@@ -684,13 +684,13 @@ pub struct JoinGuard<'a, T: Send + 'a> {
|
||||
unsafe impl<'a, T: Send + 'a> Sync for JoinGuard<'a, T> {}
|
||||
|
||||
impl<'a, T: Send + 'a> JoinGuard<'a, T> {
|
||||
/// Extract a handle to the thread this guard will join on.
|
||||
/// Extracts a handle to the thread this guard will join on.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn thread(&self) -> &Thread {
|
||||
&self.inner.thread
|
||||
}
|
||||
|
||||
/// Wait for the associated thread to finish, returning the result of the
|
||||
/// Waits for the associated thread to finish, returning the result of the
|
||||
/// thread's calculation.
|
||||
///
|
||||
/// # Panics
|
||||
|
||||
Reference in New Issue
Block a user