Mark this watcher closed and wake every waiter with [`WaitOutcome::GroupGone`]. Idempotent.
(&self)
| 75 | /// Mark this watcher closed and wake every waiter with |
| 76 | /// [`WaitOutcome::GroupGone`]. Idempotent. |
| 77 | pub fn close(&self) { |
| 78 | let mut guard = self.state.lock().unwrap_or_else(|p| p.into_inner()); |
| 79 | if !guard.closed { |
| 80 | guard.closed = true; |
| 81 | self.cv.notify_all(); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /// Block until the watermark reaches `target`, the timeout elapses, |
| 86 | /// or the watcher is closed. |