From 150b5dcaef1f4e40aaf770c1c0ac8caea5887c9d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 29 Dec 2006 20:02:02 +0100 Subject: [PATCH] loader: Use the Mach thread port as thread id on Mac OS. --- configure | 2 ++ configure.ac | 1 + include/config.h.in | 3 +++ loader/pthread.c | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/configure b/configure index a1e7660d42c..a68d2d16424 100755 --- a/configure +++ b/configure @@ -7026,6 +7026,7 @@ done + for ac_header in \ @@ -7067,6 +7068,7 @@ for ac_header in \ linux/param.h \ linux/serial.h \ linux/ucdrom.h \ + mach/mach.h \ mach/machine.h \ machine/cpu.h \ machine/limits.h \ diff --git a/configure.ac b/configure.ac index 4dd936b326f..d56250f9a93 100644 --- a/configure.ac +++ b/configure.ac @@ -197,6 +197,7 @@ AC_CHECK_HEADERS(\ linux/param.h \ linux/serial.h \ linux/ucdrom.h \ + mach/mach.h \ mach/machine.h \ machine/cpu.h \ machine/limits.h \ diff --git a/include/config.h.in b/include/config.h.in index 6f5387acbd6..581a246fcb9 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -423,6 +423,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACHINE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_MACH_H + /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE diff --git a/loader/pthread.c b/loader/pthread.c index 9a7834e5ba1..17be9e43fa7 100644 --- a/loader/pthread.c +++ b/loader/pthread.c @@ -34,6 +34,9 @@ #ifdef HAVE_SYS_MMAN_H #include #endif +#ifdef HAVE_MACH_MACH_H +#include +#endif #include "wine/library.h" #include "wine/pthread.h" @@ -144,6 +147,8 @@ static void init_current_teb( struct wine_pthread_thread_info *info ) 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