From e412619d88ee9deea9bfffe3bab57b6608faa828 Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Tue, 14 Apr 2026 22:07:57 +0200 Subject: added cancelation if nothing found --- patches/patches/093_async9.patch | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'patches') diff --git a/patches/patches/093_async9.patch b/patches/patches/093_async9.patch index ef18d3f..cb47f76 100644 --- a/patches/patches/093_async9.patch +++ b/patches/patches/093_async9.patch @@ -1,9 +1,9 @@ ---- exercises/093_async9.zig 2026-04-14 09:50:05.694073287 +0200 -+++ answers/093_async9.zig 2026-04-14 09:49:58.604934765 +0200 -@@ -61,10 +61,10 @@ - var queue = Io.Queue(SearchResult).init(&buf); +--- exercises/093_async9.zig 2026-04-14 22:06:23.644776893 +0200 ++++ answers/093_async9.zig 2026-04-14 22:06:30.606912044 +0200 +@@ -63,10 +63,10 @@ // Launch two workers, each searching half the array. + // Remember, we want them to be guaranteed separate units of concurrency. - var f1 = ???(searchRange, .{ data[0..mid], target, 0, 0, &queue, io }); + var f1 = try io.concurrent(searchThreshold, .{ io, data[0..mid], threshold, 0, 0, &queue }); defer _ = f1.cancel(io); @@ -13,8 +13,3 @@ defer _ = f2.cancel(io); // Wait for the first result. -@@ -100,4 +100,3 @@ - } - } - } -- -- cgit v1.2.3