diff options
author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2024-03-23 15:48:08 +0000 |
---|---|---|
committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2024-03-23 15:48:08 +0000 |
commit | dabd9a5a0a8d377ed91b16863a6174e898db7a12 (patch) | |
tree | 4bcc0ed5f25500e995f0d3eb6064485b22e2f8ee /patches | |
parent | cdaa246131548e3c433d8ce5243132ecf2ee1b3c (diff) | |
parent | d65e3f3f9a42d9eb1695e50763b2a81f745f5596 (diff) |
Merge pull request 'Added second threading exercise.' (#65) from threading2 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/65
Diffstat (limited to 'patches')
-rw-r--r-- | patches/patches/105_threading2.patch | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/patches/patches/105_threading2.patch b/patches/patches/105_threading2.patch new file mode 100644 index 0000000..dfa5613 --- /dev/null +++ b/patches/patches/105_threading2.patch @@ -0,0 +1,13 @@ +--- exercises/105_threading2.zig 2024-03-23 16:35:14.754540802 +0100 ++++ answers/105_threading2.zig 2024-03-23 16:38:00.577539733 +0100 +@@ -81,8 +81,8 @@ + defer handle1.join(); + + // Second thread to calculate the minus numbers. +- ??? +- ++ const handle2 = try std.Thread.spawn(.{}, thread_pi, .{ &pi_minus, 3, count }); ++ defer handle2.join(); + } + // Here we add up the results. + std.debug.print("PI ≈ {d:.8}\n", .{4 + pi_plus - pi_minus}); |