loader: Use the Mach thread port as thread id on Mac OS.
diff --git a/loader/pthread.c b/loader/pthread.c
index 9a7834e..17be9e4 100644
--- a/loader/pthread.c
+++ b/loader/pthread.c
@@ -34,6 +34,9 @@
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
+#ifdef HAVE_MACH_MACH_H
+#include <mach/mach.h>
+#endif
 
 #include "wine/library.h"
 #include "wine/pthread.h"
@@ -144,6 +147,8 @@
     info->pid = getpid();
 #ifdef __sun
     info->tid = pthread_self();  /* this should return the lwp id on solaris */
+#elif defined(__APPLE__)
+    info->tid = mach_thread_self();
 #else
     info->tid = gettid();
 #endif