| ... | @@ -280,12 +280,13 @@ pub fn getCurrentId() Id { | ... | @@ -280,12 +280,13 @@ pub fn getCurrentId() Id { |
| 280 | pub const CpuCountError = error{ | 280 | pub const CpuCountError = error{ |
| 281 | PermissionDenied, | 281 | PermissionDenied, |
| 282 | SystemResources, | 282 | SystemResources, |
| | 283 | Unsupported, |
| 283 | Unexpected, | 284 | Unexpected, |
| 284 | }; | 285 | }; |
| 285 | | 286 | |
| 286 | /// Returns the platforms view on the number of logical CPU cores available. | 287 | /// Returns the platforms view on the number of logical CPU cores available. |
| 287 | pub fn getCpuCount() CpuCountError!usize { | 288 | pub fn getCpuCount() CpuCountError!usize { |
| 288 | return Impl.getCpuCount(); | 289 | return try Impl.getCpuCount(); |
| 289 | } | 290 | } |
| 290 | | 291 | |
| 291 | /// Configuration options for hints on how to spawn threads. | 292 | /// Configuration options for hints on how to spawn threads. |
| ... | @@ -782,6 +783,10 @@ const WasiThreadImpl = struct { | ... | @@ -782,6 +783,10 @@ const WasiThreadImpl = struct { |
| 782 | return tls_thread_id; | 783 | return tls_thread_id; |
| 783 | } | 784 | } |
| 784 | | 785 | |
| | 786 | fn getCpuCount() error{Unsupported}!noreturn { |
| | 787 | return error.Unsupported; |
| | 788 | } |
| | 789 | |
| 785 | fn getHandle(self: Impl) ThreadHandle { | 790 | fn getHandle(self: Impl) ThreadHandle { |
| 786 | return self.thread.tid.load(.seq_cst); | 791 | return self.thread.tid.load(.seq_cst); |
| 787 | } | 792 | } |