std: fix a bunch of typos
The majority of these are in comments, some in doc comments which might affect the generated documentation, and a few in parameter names - nothing that should be breaking, however.
This commit is contained in:
committed by
Andrew Kelley
parent
ec6ffaa1e4
commit
94e30a756e
@@ -261,7 +261,7 @@ const FutexImpl = struct {
|
||||
const signals = (state & signal_mask) / one_signal;
|
||||
|
||||
// Reserves which waiters to wake up by incrementing the signals count.
|
||||
// Therefor, the signals count is always less than or equal to the waiters count.
|
||||
// Therefore, the signals count is always less than or equal to the waiters count.
|
||||
// We don't need to Futex.wake if there's nothing to wake up or if other wake() threads have reserved to wake up the current waiters.
|
||||
const wakeable = waiters - signals;
|
||||
if (wakeable == 0) {
|
||||
|
||||
@@ -772,7 +772,7 @@ const PosixImpl = struct {
|
||||
|
||||
waiter.event.wait(timeout) catch {
|
||||
// If we fail to cancel after a timeout, it means a wake() thread dequeued us and will wake us up.
|
||||
// We must wait until the event is set as that's a signal that the wake() thread wont access the waiter memory anymore.
|
||||
// We must wait until the event is set as that's a signal that the wake() thread won't access the waiter memory anymore.
|
||||
// If we return early without waiting, the waiter on the stack would be invalidated and the wake() thread risks a UAF.
|
||||
defer if (!cancelled) waiter.event.wait(null) catch unreachable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user