migrate from std.Target.current to @import("builtin").target

closes #9388
closes #9321
This commit is contained in:
Andrew Kelley
2021-10-04 23:47:27 -07:00
parent 78902db68b
commit 6115cf2240
147 changed files with 624 additions and 596 deletions

View File

@@ -4,6 +4,7 @@
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
const std = @import("std");
const builtin = @import("builtin");
const ThreadPool = @This();
lock: std.Thread.Mutex = .{},
@@ -57,7 +58,7 @@ pub fn init(self: *ThreadPool, allocator: *std.mem.Allocator) !void {
.allocator = allocator,
.workers = &[_]Worker{},
};
if (std.builtin.single_threaded)
if (builtin.single_threaded)
return;
const worker_count = std.math.max(1, std.Thread.getCpuCount() catch 1);
@@ -100,7 +101,7 @@ pub fn deinit(self: *ThreadPool) void {
}
pub fn spawn(self: *ThreadPool, comptime func: anytype, args: anytype) !void {
if (std.builtin.single_threaded) {
if (builtin.single_threaded) {
@call(.{}, func, args);
return;
}