diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-19 14:21:24 +0200 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-19 14:21:24 +0200 |
| commit | ca8aee84ad920f9af173e0eebf7310ebde217fef (patch) | |
| tree | 4396fca265e59ca073508e89327deb7d2935d172 /patches | |
| parent | f35c9419d2d2087e9703256a030b382ef17c6c21 (diff) | |
| parent | c4cb76ea8e1ac9b061f1436aafcd0bef55183e0f (diff) | |
Merge pull request 'Demonstrate the benefit of a mutex' (#408) from MatthijsBlom/ziglings:matthijsblom-patch-1 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/408
Diffstat (limited to 'patches')
| -rw-r--r-- | patches/patches/091_async7.patch | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/patches/patches/091_async7.patch b/patches/patches/091_async7.patch index b4bab9b..3b6b789 100644 --- a/patches/patches/091_async7.patch +++ b/patches/patches/091_async7.patch @@ -1,5 +1,5 @@ ---- exercises/091_async7.zig 2026-04-02 10:50:08.142508099 +0200 -+++ answers/091_async7.zig 2026-04-02 10:49:59.629341593 +0200 +--- exercises/091_async7.zig 2026-04-18 23:30:40.963951835 +0200 ++++ answers/091_async7.zig 2026-04-18 23:33:47.313340585 +0200 @@ -49,8 +49,8 @@ for (0..times) |_| { // Acquire the lock before modifying shared state. @@ -9,5 +9,5 @@ + state.mutex.lock(io) catch return; + defer state.mutex.unlock(io); - state.counter += 1; - } + // Sleep to give the other tasks a chance to run in the meantime. + // We do this here only to make nondeterminism more visible. |
