diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-04 23:47:27 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-04 23:48:55 -0700 |
| commit | 6115cf22404467fd13d0290fc022d51d372d139a (patch) | |
| tree | 26c0bab951c81e89b5f0edcc5dc9f4b8e64df7db /src/ThreadPool.zig | |
| parent | 78902db68bbd400f6d84b65280c31d417105f2a8 (diff) | |
| download | zig-6115cf22404467fd13d0290fc022d51d372d139a.tar.gz zig-6115cf22404467fd13d0290fc022d51d372d139a.zip | |
migrate from `std.Target.current` to `@import("builtin").target`
closes #9388
closes #9321
Diffstat (limited to 'src/ThreadPool.zig')
| -rw-r--r-- | src/ThreadPool.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ThreadPool.zig b/src/ThreadPool.zig index 7386e426eb..4198e062bb 100644 --- a/src/ThreadPool.zig +++ b/src/ThreadPool.zig @@ -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; } |
