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
commit bc83bf21dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,8 +65,8 @@ impl fmt::Debug for Barrier {
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
///