$OpenBSD: patch-src_std_thread_c,v 1.4 2020/05/19 19:36:53 thfr Exp $

enable hl_thread_id for OpenBSD using getthrid(2)

Index: src/std/thread.c
--- src/std/thread.c.orig
+++ src/std/thread.c
@@ -483,6 +483,8 @@ HL_PRIM int hl_thread_id() {
 	uint64_t tid64;
 	pthread_threadid_np(NULL, &tid64);
 	return (pid_t)tid64;
+#elif defined(__OpenBSD__)
+	return getthrid();
 #elif defined(SYS_gettid) && !defined(HL_TVOS)
 	return syscall(SYS_gettid);
 #else
