ports/156709: [patch] emulators/wine: use pthread_getthreadid_np() on 9.x post-r218414
Pan Tsu
inyaoo at gmail.com
Fri Apr 29 04:20:10 UTC 2011
>Number: 156709
>Category: ports
>Synopsis: [patch] emulators/wine: use pthread_getthreadid_np() on 9.x post-r218414
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Fri Apr 29 04:20:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Pan Tsu
>Release: FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
http://lists.freebsd.org/pipermail/freebsd-threads/2011-February/005016.html
>Description:
>How-To-Repeat:
>Fix:
--- a.diff begins here ---
--- configure.ac~
+++ configure.ac
@@ -1434,6 +1434,7 @@ dnl **** Check for pthread functions ***
WINE_CHECK_LIB_FUNCS(\
pthread_attr_get_np \
pthread_getattr_np \
+ pthread_getthreadid_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np,
[$LIBPTHREAD])
--- configure~
+++ configure
@@ -10607,6 +10607,7 @@ LIBS="$LIBS $LIBPTHREAD"
for ac_func in \
pthread_attr_get_np \
pthread_getattr_np \
+ pthread_getthreadid_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np
do :
--- include/config.h.in~
+++ include/config.h.in
@@ -647,6 +647,9 @@
/* Define to 1 if you have the `pthread_getattr_np' function. */
#undef HAVE_PTHREAD_GETATTR_NP
+/* Define to 1 if you have the `pthread_getthreadid_np' function. */
+#undef HAVE_PTHREAD_GETTHREADID_NP
+
/* Define to 1 if you have the `pthread_get_stackaddr_np' function. */
#undef HAVE_PTHREAD_GET_STACKADDR_NP
--- dlls/ntdll/server.c~
+++ dlls/ntdll/server.c
@@ -61,6 +61,9 @@
#include <sys/ucontext.h>
#include <sys/thr.h>
#endif
+#ifdef HAVE_PTHREAD_NP_H
+# include <pthread_np.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -953,6 +956,8 @@ static int get_unix_tid(void)
#elif defined(__APPLE__)
ret = mach_thread_self();
mach_port_deallocate(mach_task_self(), ret);
+#elif defined(HAVE_PTHREAD_GETTHREADID_NP)
+ ret = pthread_getthreadid_np();
#elif defined(__FreeBSD__)
long lwpid;
thr_self( &lwpid );
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list