zig/tools
Andrew Kelley 2adfd4d107 std.Io: fix and improve Group API
Rename `wait` to `await` to be consistent with Future API. The
convention here is that this set of functionality goes together:
* async/concurrent
* await/cancel

Also rename Select `wait` to `await` for the same reason.

`Group.await` now can return `error.Canceled`. Furthermore,
`Group.await` does not auto-propagate cancelation. Instead, users should
follow the pattern of `defer group.cancel(io);` after initialization,
and doing `try group.await(io);` at the end of the success path.
Advanced logic can choose to do something other than this pattern in the
event of cancelation.

Additionally, fixes a bug in `std.Io.Threaded` future await, in which it
swallowed an `error.Canceled`. Now if a task is canceled while awaiting
a future, after propagating the cancel request, it also recancels,
meaning that the awaiting task will properly detect its own cancelation
at the next cancelation point.

Furthermore, fixes a bug in the compiler where `error.Canceled` was
being swallowed in `dispatchPrelinkWork`.

Finally, fixes std.crypto code that inappropriately used
`catch unreachable` in response to cancelation without even so much as a
comment explaining why it was believed to be unreachable. Now, those
functions have `error.Canceled` in the error set and propagate
cancelation properly.

With this way of doing things, `Group.await` has a nice property: even if
all tasks in the group are CPU bound and without cancelation points, the
`Group.await` can still be canceled. In such case, the task that was
waiting for `await` wakes up with a chance to do some more resource
cleanup tasks, such as canceling more things, before entering the
deferred `Group.cancel` call at which point it has to suspend until the
canceled but uninterruptible CPU bound tasks complete.

closes #30601
2025-12-29 22:47:34 -08:00
..
crc std.hash.crc: simplify api 2024-04-28 21:12:01 +12:00
spirv spirv: snake-case the spec 2025-07-14 15:16:17 +02:00
docgen.zig langref: fix build failure 2025-12-23 22:15:12 -08:00
doctest.zig langref: fix build failure 2025-12-23 22:15:12 -08:00
dump-cov.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
fetch_them_macos_headers.zig std: add changing cur dir back 2025-12-23 22:15:12 -08:00
gen_macos_headers_c.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
gen_outline_atomics.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
gen_spirv_spec.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
gen_stubs.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
generate_c_size_and_align_checks.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
generate_JSONTestSuite.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
generate_linux_syscalls.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
incr-check.zig incr-check: more general --debug-log CLI 2025-12-26 19:58:56 -08:00
lldb_pretty_printers.py all: replace all @Type usages 2025-11-22 22:42:38 +00:00
macos-headers.c libc: Add mach-o/getsect.h and mach/exception.h macOS headers 2025-11-04 21:51:48 +00:00
migrate_langref.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
process_headers.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
stage1_gdb_pretty_printers.py gdb: restructure pretty printers into different files 2022-03-16 18:13:10 +01:00
stage2_gdb_pretty_printers.py InternPool: port most of value tags 2023-06-10 20:47:54 -07:00
std_gdb_pretty_printers.py tools: implement more lldb pretty printers 2023-02-27 05:37:03 -05:00
update-linux-headers.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
update_clang_options.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
update_cpu_features.zig std.Io: fix and improve Group API 2025-12-29 22:47:34 -08:00
update_crc_catalog.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
update_freebsd_libc.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
update_glibc.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
update_mingw.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
update_netbsd_libc.zig test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
zig_gdb_pretty_printers.py Update GDB pretty printers 2023-03-30 12:15:53 +03:00