From 189376944cbc9d1a70673d8d5dc49a3d190ff5fc Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Sat, 15 Nov 2025 17:58:27 +0100 Subject: [PATCH 1/2] fixed path for freeBSD --- patches/eowyn.sh | 2 +- patches/frodo.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/eowyn.sh b/patches/eowyn.sh index afc2732..62c1934 100755 --- a/patches/eowyn.sh +++ b/patches/eowyn.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # "I will be a shieldmaiden no longer, # nor vie with the great Riders, nor diff --git a/patches/frodo.sh b/patches/frodo.sh index a92642a..7d04571 100755 --- a/patches/frodo.sh +++ b/patches/frodo.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # "How do you pick up the threads of an old life? # How do you go on, when in your heart you begin From 11d81721367fc29e882fbf893a10240174d75ff6 Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Sat, 15 Nov 2025 19:14:36 +0100 Subject: [PATCH 2/2] forgotten thread-sleep fix added --- exercises/104_threading.zig | 6 +++--- patches/patches/104_threading.patch | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/104_threading.zig b/exercises/104_threading.zig index 638769f..7c5e0f7 100644 --- a/exercises/104_threading.zig +++ b/exercises/104_threading.zig @@ -106,7 +106,7 @@ pub fn main() !void { // After the threads have been started, // they run in parallel and we can still do some work in between. - std.Thread.sleep(1500 * std.time.ns_per_ms); + std.posix.nanosleep(4, 0); std.debug.print("Some weird stuff, after starting the threads.\n", .{}); } // After we have left the closed area, we wait until @@ -117,12 +117,12 @@ pub fn main() !void { // This function is started with every thread that we set up. // In our example, we pass the number of the thread as a parameter. fn thread_function(num: usize) !void { - std.Thread.sleep(200 * num * std.time.ns_per_ms); + std.posix.nanosleep(1 * num, 0); std.debug.print("thread {d}: {s}\n", .{ num, "started." }); // This timer simulates the work of the thread. const work_time = 3 * ((5 - num % 3) - 2); - std.Thread.sleep(work_time * std.time.ns_per_s); + std.posix.nanosleep(work_time, 0); std.debug.print("thread {d}: {s}\n", .{ num, "finished." }); } diff --git a/patches/patches/104_threading.patch b/patches/patches/104_threading.patch index 1ca46c1..51d7035 100644 --- a/patches/patches/104_threading.patch +++ b/patches/patches/104_threading.patch @@ -1,5 +1,5 @@ ---- exercises/104_threading.zig 2024-04-10 19:12:29.878856370 +0200 -+++ answers/104_threading.zig 2024-04-10 19:11:22.304265713 +0200 +--- exercises/104_threading.zig 2025-11-15 19:13:35.359496111 +0100 ++++ answers/104_threading.zig 2025-11-15 19:11:20.468752429 +0100 @@ -97,12 +97,12 @@ defer handle.join();