summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorTom <git@halffull.org>2026-04-13 19:08:24 -0700
committerTom <git@halffull.org>2026-04-13 19:11:39 -0700
commitb8a639e79836f916286c8d55e53a263cd782e8ab (patch)
tree142e7016de7d03af4db0728985054537abd14c34 /patches
parentb9cbe199ab257cac447412cd924d4e833a9f7b7b (diff)
095_quiz_async: Add missing Bug 4
Diffstat (limited to 'patches')
-rw-r--r--patches/patches/095_quiz_async.patch16
1 files changed, 8 insertions, 8 deletions
diff --git a/patches/patches/095_quiz_async.patch b/patches/patches/095_quiz_async.patch
index e3d2a79..78f7944 100644
--- a/patches/patches/095_quiz_async.patch
+++ b/patches/patches/095_quiz_async.patch
@@ -1,5 +1,5 @@
---- exercises/095_quiz_async.zig 2026-04-06 19:55:17.111817364 +0200
-+++ answers/095_quiz_async.zig 2026-04-06 19:56:16.063974543 +0200
+--- exercises/095_quiz_async.zig 2026-04-13 19:11:04.173440326 -0700
++++ answers/095_quiz_async.zig 2026-04-13 19:10:31.618592222 -0700
@@ -51,7 +51,7 @@
fn addReading(self: *GardenWeather, io: std.Io, reading: Reading) void {
// Bug 1: The collector needs to lock before modifying
@@ -18,7 +18,7 @@
defer _ = collector_future.cancel(io);
// Sensor group: the sensors can use async — they just need
-@@ -91,7 +91,7 @@
+@@ -91,22 +91,22 @@
// Bug 3: Wait for ALL sensors to finish sending their readings.
// What Group method blocks until all tasks complete?
@@ -27,11 +27,11 @@
// All sensors done — close the queue so the collector knows
// there's no more data coming.
-@@ -99,15 +99,14 @@
+ queue.close(io);
- // Wait for the collector to drain the remaining queue.
- _ = collector_future.await(io);
-- // _ = collector_future.???(io);
+ // Bug 4: How do we wait for the collector to drain the remaining queue?
+- _ = collector_future.???(io);
++ _ = collector_future.await(io);
// Now write the garden report. This is critical — it must
// NOT be interrupted, even if something tries to cancel us!
@@ -45,7 +45,7 @@
printGardenReport(&weather);
}
-@@ -129,7 +128,7 @@
+@@ -128,7 +128,7 @@
// Bug 6: Send the reading into the queue.
// What Queue method sends a single element?