Skip to content

Commit

Permalink
Add comments describing AwaitNotify struct
Browse files Browse the repository at this point in the history
And remove an unnneded comment in a Debug implementation
  • Loading branch information
tmccombs committed Apr 11, 2020
1 parent 552928d commit e4b2870
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,23 @@ impl Condvar {

impl fmt::Debug for Condvar {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
//f.debug_struct("Condvar").finish()
f.pad("Condvar { .. }")
}
}

/// A future that waits for another task to notify the condition variable.
///
/// This is an internal future that `wait` and `wait_until` await on.
struct AwaitNotify<'a, 'b, T> {
/// The condition variable that we are waiting on
cond: &'a Condvar,
/// The lock used with `cond`.
/// This will be released the first time the future is polled,
/// after registering the context to be notified.
guard: Option<MutexGuard<'b, T>>,
/// A key into the conditions variable's `WakerSet`.
/// This is set to the index of the `Waker` for the context each time
/// the future is polled and not completed.
key: Option<usize>,
}

Expand Down

0 comments on commit e4b2870

Please sign in to comment.