Skip to content

Commit 01bf220

Browse files
authored
Clarify edge cases for Barrier::new
... since n-1 is undefined when the usize n is 0.
1 parent c268b39 commit 01bf220

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/sync/barrier.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ impl Barrier {
6868
/// A barrier will block `n`-1 threads which call [`wait()`] and then wake
6969
/// up all threads at once when the `n`th thread calls [`wait()`].
7070
///
71+
/// If `n` is 0, the barrier acts the same as `n` is 1.
72+
///
7173
/// [`wait()`]: Barrier::wait
7274
///
7375
/// # Examples

0 commit comments

Comments
 (0)