Created
April 13, 2023 22:46
-
-
Save matu3ba/3f4dbb975ad8e656828bdd9073beb923 to your computer and use it in GitHub Desktop.
Idea for zig thread status (macos implementation idea missing and other portable questions on freebsd etc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig | |
index 8004f94d7f..22996939a3 100644 | |
--- a/lib/std/Thread.zig | |
+++ b/lib/std/Thread.zig | |
@@ -275,6 +275,14 @@ pub fn getCurrentId() Id { | |
return Impl.getCurrentId(); | |
} | |
+pub fn getStatus() c_int { | |
+ // https://stackoverflow.com/questions/9577231/how-to-check-the-state-of-linux-threads | |
+ // => parse /self/proc | |
+ // darwin: darwin thread_get_state looks to be Kernel internal | |
+ // windows: https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntquerysysteminformation | |
+ return 0; | |
+} | |
+ | |
pub const CpuCountError = error{ | |
PermissionDenied, | |
SystemResources, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment