From inyaoo@gmail.com  Fri Apr 29 04:13:27 2011
Return-Path: <inyaoo@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8AAAB106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Apr 2011 04:13:27 +0000 (UTC)
	(envelope-from inyaoo@gmail.com)
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 17A828FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Apr 2011 04:13:26 +0000 (UTC)
Received: by bwz12 with SMTP id 12so4044611bwz.13
        for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Apr 2011 21:13:26 -0700 (PDT)
Received: by 10.204.74.68 with SMTP id t4mr1754100bkj.22.1304050405817;
        Thu, 28 Apr 2011 21:13:25 -0700 (PDT)
Received: from localhost (chomsky.torservers.net [77.247.181.162])
        by mx.google.com with ESMTPS id w3sm1370522bkt.5.2011.04.28.21.13.22
        (version=SSLv3 cipher=OTHER);
        Thu, 28 Apr 2011 21:13:25 -0700 (PDT)
Message-Id: <86oc3pitk4.fsf@gmail.com>
Date: Fri, 29 Apr 2011 08:13:15 +0400
From: Pan Tsu <inyaoo@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] emulators/wine: use pthread_getthreadid_np() on 9.x post-r218414

>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:    gerald
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 29 04:20:09 UTC 2011
>Closed-Date:    Sat Jun 18 15:26:36 UTC 2011
>Last-Modified:  Sat Jun 18 15:26:36 UTC 2011
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->gerald 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Apr 29 04:20:20 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156709 
State-Changed-From-To: open->feedback 
State-Changed-By: gerald 
State-Changed-When: Sun May 1 13:17:48 UTC 2011 
State-Changed-Why:  
That looks like a good change.  Would you mind submitting upstream 
to wine-patches@winehq.com?  Feel free to copy me, and it should go 
in quickly (or I'll ping it). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156709 
State-Changed-From-To: feedback->closed 
State-Changed-By: gerald 
State-Changed-When: Sat Jun 18 15:25:17 UTC 2011 
State-Changed-Why:  
Pan Tsu and me discussed this and the way to go is via upstream which 
hopefully he'll be able to do time permitting. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156709 
>Unformatted:
