mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
docs: more doc fixes (#2831)
Previous docs look like they were based on the docs for `insert_at`. Changed names of variables referred to and the explanation of when the value will be returned and under what condition it will be immediately available to make sense for a Duration argument instead of an Instant.
This commit is contained in:
@@ -406,7 +406,7 @@
|
||||
//!
|
||||
//! The remaining synchronization primitives focus on synchronizing state.
|
||||
//! These are asynchronous equivalents to versions provided by `std`. They
|
||||
//! operate in a similar way as their `std` counterparts parts but will wait
|
||||
//! operate in a similar way as their `std` counterparts but will wait
|
||||
//! asynchronously instead of blocking the thread.
|
||||
//!
|
||||
//! * [`Barrier`](Barrier) Ensures multiple tasks will wait for each other to
|
||||
|
||||
@@ -11,7 +11,7 @@ const MAX_READS: usize = 32;
|
||||
#[cfg(loom)]
|
||||
const MAX_READS: usize = 10;
|
||||
|
||||
/// An asynchronous reader-writer lock
|
||||
/// An asynchronous reader-writer lock.
|
||||
///
|
||||
/// This type of lock allows a number of readers or at most one writer at any
|
||||
/// point in time. The write portion of this lock typically allows modification
|
||||
|
||||
@@ -366,23 +366,25 @@ impl<T> DelayQueue<T> {
|
||||
/// This function is identical to `insert_at`, but takes a `Duration`
|
||||
/// instead of an `Instant`.
|
||||
///
|
||||
/// `value` is stored in the queue until `when` is reached. At which point,
|
||||
/// `value` will be returned from [`poll_expired`]. If `when` has already been
|
||||
/// reached, then `value` is immediately made available to poll.
|
||||
/// `value` is stored in the queue until `timeout` duration has
|
||||
/// elapsed after `insert` was called. At that point, `value` will
|
||||
/// be returned from [`poll_expired`]. If `timeout` a Duration of
|
||||
/// zero, then `value` is immediately made available to poll.
|
||||
///
|
||||
/// 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 either by calling [`poll_expired`] 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.
|
||||
/// The return value represents the insertion and is used as an
|
||||
/// argument to [`remove`] and [`reset`]. Note that [`Key`] is a
|
||||
/// token and is reused once `value` is removed from the queue
|
||||
/// either by calling [`poll_expired`] after `timeout` has elapsed
|
||||
/// or by calling [`remove`]. At this point, the caller must not
|
||||
/// use the returned [`Key`] again as it may reference a different
|
||||
/// item in the queue.
|
||||
///
|
||||
/// See [type] level documentation for more details.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This function panics if `timeout` is greater than the maximum supported
|
||||
/// duration.
|
||||
/// This function panics if `timeout` is greater than the maximum
|
||||
/// duration supported by the timer in the current `Runtime`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user