| author | |
| committer | |
| log | 166402c16bddccc364b9108a9e69af3a0dd6f1ab |
| tree | 4557630cf8d32fbcf54e30c687819638615e122d |
| parent | bdae01ab047accbbc6dcd014d008f2554aa78696 |
2 files changed, 7 insertions(+), 2 deletions(-)
lib/std/Thread.zig+6-1| ... | ... | @@ -280,12 +280,13 @@ pub fn getCurrentId() Id { |
| 280 | 280 | pub const CpuCountError = error{ |
| 281 | 281 | PermissionDenied, |
| 282 | 282 | SystemResources, |
| 283 | Unsupported, | |
| 283 | 284 | Unexpected, |
| 284 | 285 | }; |
| 285 | 286 | |
| 286 | 287 | /// Returns the platforms view on the number of logical CPU cores available. |
| 287 | 288 | pub fn getCpuCount() CpuCountError!usize { |
| 288 | return Impl.getCpuCount(); | |
| 289 | return try Impl.getCpuCount(); | |
| 289 | 290 | } |
| 290 | 291 | |
| 291 | 292 | /// Configuration options for hints on how to spawn threads. |
| ... | ... | @@ -782,6 +783,10 @@ const WasiThreadImpl = struct { |
| 782 | 783 | return tls_thread_id; |
| 783 | 784 | } |
| 784 | 785 | |
| 786 | fn getCpuCount() error{Unsupported}!noreturn { | |
| 787 | return error.Unsupported; | |
| 788 | } | |
| 789 | ||
| 785 | 790 | fn getHandle(self: Impl) ThreadHandle { |
| 786 | 791 | return self.thread.tid.load(.seq_cst); |
| 787 | 792 | } |
src/link.zig+1-1| ... | ... | @@ -538,7 +538,7 @@ pub const File = struct { |
| 538 | 538 | pub fn flush(base: *File, arena: Allocator, tid: Zcu.PerThread.Id, prog_node: std.Progress.Node) FlushError!void { |
| 539 | 539 | if (build_options.only_c) { |
| 540 | 540 | assert(base.tag == .c); |
| 541 | return @as(*C, @fieldParentPtr("base", base)).flush(arena, prog_node); | |
| 541 | return @as(*C, @fieldParentPtr("base", base)).flush(arena, tid, prog_node); | |
| 542 | 542 | } |
| 543 | 543 | const comp = base.comp; |
| 544 | 544 | if (comp.clang_preprocessor_mode == .yes or comp.clang_preprocessor_mode == .pch) { |