Skip to content

Commit

Permalink
Rollup merge of rust-lang#83740 - obi1kenobi:patch-1, r=joshtriplett
Browse files Browse the repository at this point in the history
Fix comment typo in once.rs

I believe I came across a minor typo in a comment. I am not particularly familiar with this part of the codebase, but I have read the surrounding code as well as the referenced `park` and `unpark` functions, and I believe my proposed change is true to the intended meaning of the comment.

I intentionally tried to keep the change as minimal as possible. If I have the maintainers' permission, I'd also love to add a comma to improve readability as follows: `Luckily ``park`` comes with the guarantee that if it got an ``unpark`` just before on an unparked thread, it does not park.`
  • Loading branch information
Dylan-DPC committed Apr 1, 2021
2 parents d101414 + 2e4215c commit e333d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ fn wait(state_and_queue: &AtomicUsize, mut current_state: usize) {
// If the managing thread happens to signal and unpark us before we
// can park ourselves, the result could be this thread never gets
// unparked. Luckily `park` comes with the guarantee that if it got
// an `unpark` just before on an unparked thread is does not park.
// an `unpark` just before on an unparked thread it does not park.
thread::park();
}
break;
Expand Down

0 comments on commit e333d69

Please sign in to comment.