Propper thread identification on NetBSD

This commit is contained in:
Andreas T Jonsson
2024-06-05 11:06:14 +02:00
parent 2c580aa6fb
commit ed6667ebf2
2 changed files with 12 additions and 3 deletions
+6 -2
View File
@@ -1,8 +1,12 @@
//+private
package sync
import "core:sys/unix"
foreign import libc "system:c"
foreign libc {
_lwp_self :: proc "c" () -> i32 ---
}
_current_thread_id :: proc "contextless" () -> int {
return cast(int) unix.pthread_self()
return int(_lwp_self())
}