Browse Source

Remove os dependency in primitives_openbsd.odin

gingerBill 2 years ago
parent
commit
2fda3cf988
1 changed files with 8 additions and 2 deletions
  1. 8 2
      core/sync/primitives_openbsd.odin

+ 8 - 2
core/sync/primitives_openbsd.odin

@@ -2,8 +2,14 @@
 //+private
 package sync
 
-import "core:os"
+foreign import libc "system:c"
+
+@(default_calling_convention="c")
+foreign libc {
+	@(link_name="getthrid", private="file")
+	_unix_getthrid :: proc() -> int ---
+}
 
 _current_thread_id :: proc "contextless" () -> int {
-	return os.current_thread_id()
+	return _unix_getthrid()
 }