Commit 9213aa789b

Andrew Kelley <andrew@ziglang.org>
2022-04-06 08:13:39
stage2: ThreadPool: update to new function pointer semantics
1 parent dd9782a
Changed files (1)
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 {