my ziglings
0

Configure Feed

Select the types of activity you want to include in your feed.

Update patches/patches/091_async7.patch

MatthijsBlom (Apr 18, 2026, 11:50 PM +0200) c4cb76ea e0470c4f

+4 -4
+4 -4
patches/patches/091_async7.patch
··· 1 - --- exercises/091_async7.zig 2026-04-02 10:50:08.142508099 +0200 2 - +++ answers/091_async7.zig 2026-04-02 10:49:59.629341593 +0200 1 + --- exercises/091_async7.zig 2026-04-18 23:30:40.963951835 +0200 2 + +++ answers/091_async7.zig 2026-04-18 23:33:47.313340585 +0200 3 3 @@ -49,8 +49,8 @@ 4 4 for (0..times) |_| { 5 5 // Acquire the lock before modifying shared state. ··· 9 9 + state.mutex.lock(io) catch return; 10 10 + defer state.mutex.unlock(io); 11 11 12 - state.counter += 1; 13 - } 12 + // Sleep to give the other tasks a chance to run in the meantime. 13 + // We do this here only to make nondeterminism more visible.