aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-04-05 23:13:39 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-04-05 23:16:35 -0700
commit9213aa789b4b44711f2747e5ab053a2b1f57a15b (patch)
treebfa889f03f3dc80430eb2e832da0bbbb53f8bff6 /src
parentdd9782a8bc6f4af458a04cea2619f55e749c39ee (diff)
downloadzig-9213aa789b4b44711f2747e5ab053a2b1f57a15b.tar.gz
zig-9213aa789b4b44711f2747e5ab053a2b1f57a15b.zip
stage2: ThreadPool: update to new function pointer semantics
Diffstat (limited to 'src')
-rw-r--r--src/ThreadPool.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ThreadPool.zig b/src/ThreadPool.zig
index ac95def319..36d004cfc6 100644
--- a/src/ThreadPool.zig
+++ b/src/ThreadPool.zig
@@ -12,7 +12,12 @@ idle_queue: IdleQueue = .{},
const IdleQueue = std.SinglyLinkedList(std.Thread.ResetEvent);
const RunQueue = std.SinglyLinkedList(Runnable);
const Runnable = struct {
- runFn: fn (*Runnable) void,
+ runFn: RunProto,
+};
+
+const RunProto = switch (builtin.zig_backend) {
+ .stage1 => fn (*Runnable) void,
+ else => *const fn (*Runnable) void,
};
const Worker = struct {