diff --git a/lib/std/event/loop.zig b/lib/std/event/loop.zig index 87d84acba6..26cbf3b988 100644 --- a/lib/std/event/loop.zig +++ b/lib/std/event/loop.zig @@ -137,7 +137,7 @@ pub const Loop = struct { } /// After initialization, call run(). - /// This is the same as `initThreadPool` using `Thread.cpuCount` to determine the thread + /// This is the same as `initThreadPool` using `Thread.getCpuCount` to determine the thread /// pool size. /// TODO copy elision / named return values so that the threads referencing *Loop /// have the correct pointer value. @@ -145,7 +145,7 @@ pub const Loop = struct { pub fn initMultiThreaded(self: *Loop) !void { if (builtin.single_threaded) @compileError("initMultiThreaded unavailable when building in single-threaded mode"); - const core_count = try Thread.cpuCount(); + const core_count = try Thread.getCpuCount(); return self.initThreadPool(core_count); } diff --git a/lib/std/os/test.zig b/lib/std/os/test.zig index 0bfe29d64b..472da73235 100644 --- a/lib/std/os/test.zig +++ b/lib/std/os/test.zig @@ -364,7 +364,7 @@ fn start2(ctx: *i32) u8 { test "cpu count" { if (native_os == .wasi) return error.SkipZigTest; - const cpu_count = try Thread.cpuCount(); + const cpu_count = try Thread.getCpuCount(); try expect(cpu_count >= 1); } diff --git a/src/ThreadPool.zig b/src/ThreadPool.zig index 230608df4b..18818c7d9d 100644 --- a/src/ThreadPool.zig +++ b/src/ThreadPool.zig @@ -60,7 +60,7 @@ pub fn init(self: *ThreadPool, allocator: *std.mem.Allocator) !void { if (std.builtin.single_threaded) return; - const worker_count = std.math.max(1, std.Thread.cpuCount() catch 1); + const worker_count = std.math.max(1, std.Thread.getCpuCount() catch 1); self.workers = try allocator.alloc(Worker, worker_count); errdefer allocator.free(self.workers);