mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-08 07:50:00 +00:00
093_async9: small fixes
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
--- 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 08:32:33.014583120 -0700
|
||||
+++ answers/093_async9.zig 2026-04-14 08:32:24.459647047 -0700
|
||||
@@ -62,10 +62,10 @@
|
||||
|
||||
// Launch two workers, each searching half the array.
|
||||
- var f1 = ???(searchRange, .{ data[0..mid], target, 0, 0, &queue, io });
|
||||
// Remember, we want them to be guaranteed separate units of concurrency.
|
||||
- var f1 = ???(searchThreshold, .{ io, data[0..mid], threshold, 0, 0, &queue });
|
||||
+ var f1 = try io.concurrent(searchThreshold, .{ io, data[0..mid], threshold, 0, 0, &queue });
|
||||
defer _ = f1.cancel(io);
|
||||
|
||||
- var f2 = ???(searchRange, .{ data[mid..], target, mid, 1, &queue, io });
|
||||
- var f2 = ???(searchThreshold, .{ io, data[mid..], threshold, mid, 1, &queue });
|
||||
+ var f2 = try io.concurrent(searchThreshold, .{ io, data[mid..], threshold, mid, 1, &queue });
|
||||
defer _ = f2.cancel(io);
|
||||
|
||||
// Wait for the first result.
|
||||
@@ -100,4 +100,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user