Rollup merge of #149236 - tisonkun:patch-1, r=tgross35

Clarify edge cases for Barrier::new

... since n-1 is undefined when the usize n is 0.
This commit is contained in:
Matthias Krüger
2025-11-30 12:03:23 +01:00
committed by GitHub
+2 -2
View File
@@ -65,8 +65,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
impl Barrier {
/// Creates a new barrier that can block a given number of threads.
///
/// A barrier will block `n`-1 threads which call [`wait()`] and then wake
/// up all threads at once when the `n`th thread calls [`wait()`].
/// A barrier will block all threads which call [`wait()`] until the `n`th thread calls [`wait()`],
/// and then wake up all threads at once.
///
/// [`wait()`]: Barrier::wait
///