aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/Thread.zig')
-rw-r--r--lib/std/Thread.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig
index 5bfaef6127..25261053ee 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -280,12 +280,13 @@ pub fn getCurrentId() Id {
pub const CpuCountError = error{
PermissionDenied,
SystemResources,
+ Unsupported,
Unexpected,
};
/// Returns the platforms view on the number of logical CPU cores available.
pub fn getCpuCount() CpuCountError!usize {
- return Impl.getCpuCount();
+ return try Impl.getCpuCount();
}
/// Configuration options for hints on how to spawn threads.
@@ -782,6 +783,10 @@ const WasiThreadImpl = struct {
return tls_thread_id;
}
+ fn getCpuCount() error{Unsupported}!noreturn {
+ return error.Unsupported;
+ }
+
fn getHandle(self: Impl) ThreadHandle {
return self.thread.tid.load(.seq_cst);
}