authorgravatar for mrjbq7@gmail.comJohn Benediktsson <mrjbq7@gmail.com> 2025-10-29 21:40:13-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-10-30 04:40:13+00:00
log74c23a237ef5245b63eb06b832a511aabeb715c0
tree761a4a85b78662a83078a18f1a49973c22854ed0
parent1d80c9540af9b3c577c8cca740247b968e7e59f1
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25763 from mrjbq7/cancelled

rename Cancelled to Canceled

6 files changed, 17 insertions(+), 17 deletions(-)

lib/std/Build/Watch.zig+1-1
......@@ -615,7 +615,7 @@ const Os = switch (builtin.os.tag) {
615615 },
616616 .Timeout => break .timeout,
617617 // This status is issued because CancelIo was called, skip and try again.
618 .Cancelled => continue,
618 .Canceled => continue,
619619 else => break error.Unexpected,
620620 };
621621 }
lib/std/Io/test.zig+1-1
......@@ -167,7 +167,7 @@ test "Group cancellation" {
167167
168168fn sleep(io: Io, result: *usize) void {
169169 // TODO when cancellation race bug is fixed, make this timeout much longer so that
170 // it causes the unit test to be failed if not cancelled.
170 // it causes the unit test to be failed if not canceled.
171171 io.sleep(.fromMilliseconds(1), .awake) catch {};
172172 result.* = 1;
173173}
lib/std/Thread/Futex.zig+8-8
......@@ -796,10 +796,10 @@ const PosixImpl = struct {
796796 var pending = bucket.pending.fetchAdd(1, .acquire);
797797 assert(pending < std.math.maxInt(usize));
798798
799 // If the wait gets cancelled, remove the pending count we previously added.
799 // If the wait gets canceled, remove the pending count we previously added.
800800 // This is done outside the mutex lock to keep the critical section short in case of contention.
801 var cancelled = false;
802 defer if (cancelled) {
801 var canceled = false;
802 defer if (canceled) {
803803 pending = bucket.pending.fetchSub(1, .monotonic);
804804 assert(pending > 0);
805805 };
......@@ -809,8 +809,8 @@ const PosixImpl = struct {
809809 assert(c.pthread_mutex_lock(&bucket.mutex) == .SUCCESS);
810810 defer assert(c.pthread_mutex_unlock(&bucket.mutex) == .SUCCESS);
811811
812 cancelled = ptr.load(.monotonic) != expect;
813 if (cancelled) {
812 canceled = ptr.load(.monotonic) != expect;
813 if (canceled) {
814814 return;
815815 }
816816
......@@ -827,13 +827,13 @@ const PosixImpl = struct {
827827 // If we fail to cancel after a timeout, it means a wake() thread dequeued us and will wake us up.
828828 // We must wait until the event is set as that's a signal that the wake() thread won't access the waiter memory anymore.
829829 // If we return early without waiting, the waiter on the stack would be invalidated and the wake() thread risks a UAF.
830 defer if (!cancelled) waiter.event.wait(null) catch unreachable;
830 defer if (!canceled) waiter.event.wait(null) catch unreachable;
831831
832832 assert(c.pthread_mutex_lock(&bucket.mutex) == .SUCCESS);
833833 defer assert(c.pthread_mutex_unlock(&bucket.mutex) == .SUCCESS);
834834
835 cancelled = WaitQueue.tryRemove(&bucket.treap, address, &waiter);
836 if (cancelled) {
835 canceled = WaitQueue.tryRemove(&bucket.treap, address, &waiter);
836 if (canceled) {
837837 return error.Timeout;
838838 }
839839 };
lib/std/os/linux/IoUring.zig+2-2
......@@ -848,7 +848,7 @@ pub fn timeout(
848848///
849849/// The timeout is identified by its `user_data`.
850850///
851/// The completion event result will be `0` if the timeout was found and cancelled successfully,
851/// The completion event result will be `0` if the timeout was found and canceled successfully,
852852/// `-EBUSY` if the timeout was found but expiration was already in progress, or
853853/// `-ENOENT` if the timeout was not found.
854854pub fn timeout_remove(
......@@ -972,7 +972,7 @@ pub fn statx(
972972///
973973/// The operation is identified by its `user_data`.
974974///
975/// The completion event result will be `0` if the operation was found and cancelled successfully,
975/// The completion event result will be `0` if the operation was found and canceled successfully,
976976/// `-EALREADY` if the operation was found but was already in progress, or
977977/// `-ENOENT` if the operation was not found.
978978pub fn cancel(
lib/std/os/windows.zig+4-4
......@@ -522,7 +522,7 @@ pub fn PostQueuedCompletionStatus(
522522pub const GetQueuedCompletionStatusResult = enum {
523523 Normal,
524524 Aborted,
525 Cancelled,
525 Canceled,
526526 EOF,
527527 Timeout,
528528};
......@@ -543,7 +543,7 @@ pub fn GetQueuedCompletionStatus(
543543 ) == FALSE) {
544544 switch (GetLastError()) {
545545 .ABANDONED_WAIT_0 => return GetQueuedCompletionStatusResult.Aborted,
546 .OPERATION_ABORTED => return GetQueuedCompletionStatusResult.Cancelled,
546 .OPERATION_ABORTED => return GetQueuedCompletionStatusResult.Canceled,
547547 .HANDLE_EOF => return GetQueuedCompletionStatusResult.EOF,
548548 .WAIT_TIMEOUT => return GetQueuedCompletionStatusResult.Timeout,
549549 else => |err| {
......@@ -559,7 +559,7 @@ pub fn GetQueuedCompletionStatus(
559559
560560pub const GetQueuedCompletionStatusError = error{
561561 Aborted,
562 Cancelled,
562 Canceled,
563563 EOF,
564564 Timeout,
565565} || UnexpectedError;
......@@ -584,7 +584,7 @@ pub fn GetQueuedCompletionStatusEx(
584584 if (success == FALSE) {
585585 return switch (GetLastError()) {
586586 .ABANDONED_WAIT_0 => error.Aborted,
587 .OPERATION_ABORTED => error.Cancelled,
587 .OPERATION_ABORTED => error.Canceled,
588588 .HANDLE_EOF => error.EOF,
589589 .WAIT_TIMEOUT => error.Timeout,
590590 else => |err| unexpectedError(err),
lib/std/os/windows/win32error.zig+1-1
......@@ -624,7 +624,7 @@ pub const Win32Error = enum(u16) {
624624 DATA_NOT_ACCEPTED = 592,
625625 /// NTVDM encountered a hard error.
626626 VDM_HARD_ERROR = 593,
627 /// {Cancel Timeout} The driver %hs failed to complete a cancelled I/O request in the allotted time.
627 /// {Cancel Timeout} The driver %hs failed to complete a canceled I/O request in the allotted time.
628628 DRIVER_CANCEL_TIMEOUT = 594,
629629 /// {Reply Message Mismatch} An attempt was made to reply to an LPC message, but the thread specified by the client ID in the message was not waiting on that message.
630630 REPLY_MESSAGE_MISMATCH = 595,