enable hl_thread_id for OpenBSD using getthrid(2)
pthread_setname_np -> pthread_set_name_np

Index: src/std/thread.c
--- src/std/thread.c.orig
+++ src/std/thread.c
@@ -25,6 +25,11 @@
 typedef struct _hl_semaphore hl_semaphore;
 typedef struct _hl_condition hl_condition;
 
+#ifdef __OpenBSD__
+#include <pthread_np.h>
+#define pthread_setname_np(a,b) pthread_set_name_np(a,b)
+#endif
+
 #if !defined(HL_THREADS)
 
 struct _hl_mutex {
@@ -839,6 +844,8 @@ HL_PRIM int hl_thread_id() {
 	return (pid_t)tid64;
 #elif defined(SYS_gettid) && !defined(HL_TVOS)
 	return syscall(SYS_gettid);
+#elif defined(__OpenBSD__)
+	return getthrid();
 #else
 	return -1;
 #endif
@@ -973,7 +980,7 @@ HL_PRIM void hl_thread_set_name( hl_thread *t, const c
 #elif defined(HL_MAC)
 	// pthread_setname_np only possible for current thread
 #else
-	pthread_setname_np((pthread_t)t,name);
+	pthread_set_name_np((pthread_t)t,name);
 #endif
 #ifdef HL_THREADS
 	hl_threads_info *threads = hl_gc_threads_info();
