Tijl Coosemans : loader/pthread: Added pthread_attr_get_np support.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 7 07:13:17 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: fc8172f7eea19aaa7b80d72ac255a4905a0bed2c
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=fc8172f7eea19aaa7b80d72ac255a4905a0bed2c

Author: Tijl Coosemans <tijl at ulyssis.org>
Date:   Sat Aug  5 23:31:07 2006 +0200

loader/pthread: Added pthread_attr_get_np support.

---

 configure              |    4 ++++
 configure.ac           |    2 ++
 include/config.h.in    |    6 ++++++
 include/wine/pthread.h |    3 +++
 loader/pthread.c       |    6 ++++++
 5 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 254ec3b..114bead 100755
--- a/configure
+++ b/configure
@@ -8339,6 +8339,7 @@ done
 
 
 
+
 for ac_header in \
 	AudioUnit/AudioUnit.h \
 	CoreAudio/CoreAudio.h \
@@ -8393,6 +8394,7 @@ for ac_header in \
 	poll.h \
 	process.h \
 	pthread.h \
+	pthread_np.h \
 	pwd.h \
 	regex.h \
 	sched.h \
@@ -13955,7 +13957,9 @@ LIBS="$LIBS $LIBPTHREAD"
 
 
 
+
 for ac_func in \
+        pthread_attr_get_np \
         pthread_getattr_np \
         pthread_get_stackaddr_np \
         pthread_get_stacksize_np
diff --git a/configure.ac b/configure.ac
index 963746f..8f7ae2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,7 @@ AC_CHECK_HEADERS(\
 	poll.h \
 	process.h \
 	pthread.h \
+	pthread_np.h \
 	pwd.h \
 	regex.h \
 	sched.h \
@@ -779,6 +780,7 @@ #include <pthread.h>])
 
 dnl **** Check for pthread functions ****
 WINE_CHECK_LIB_FUNCS(\
+        pthread_attr_get_np \
         pthread_getattr_np \
         pthread_get_stackaddr_np \
         pthread_get_stacksize_np,
diff --git a/include/config.h.in b/include/config.h.in
index 3d1d4b5..5cb7384 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -521,6 +521,9 @@ #undef HAVE_PREAD
 /* Define to 1 if you have the <process.h> header file. */
 #undef HAVE_PROCESS_H
 
+/* Define to 1 if you have the `pthread_attr_get_np' function. */
+#undef HAVE_PTHREAD_ATTR_GET_NP
+
 /* Define to 1 if you have the `pthread_getattr_np' function. */
 #undef HAVE_PTHREAD_GETATTR_NP
 
@@ -533,6 +536,9 @@ #undef HAVE_PTHREAD_GET_STACKSIZE_NP
 /* Define to 1 if you have the <pthread.h> header file. */
 #undef HAVE_PTHREAD_H
 
+/* Define to 1 if you have the <pthread_np.h> header file. */
+#undef HAVE_PTHREAD_NP_H
+
 /* Define to 1 if the system has the type `pthread_rwlockattr_t'. */
 #undef HAVE_PTHREAD_RWLOCKATTR_T
 
diff --git a/include/wine/pthread.h b/include/wine/pthread.h
index 69a1562..1971ebb 100644
--- a/include/wine/pthread.h
+++ b/include/wine/pthread.h
@@ -29,6 +29,9 @@ #ifdef HAVE_PTHREAD_H
 
 #define _GNU_SOURCE
 #include <pthread.h>
+#ifdef HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
 
 #ifndef HAVE_PTHREAD_RWLOCK_T
 typedef void *pthread_rwlock_t;
diff --git a/loader/pthread.c b/loader/pthread.c
index a976c4f..526633e 100644
--- a/loader/pthread.c
+++ b/loader/pthread.c
@@ -70,6 +70,12 @@ #ifdef HAVE_PTHREAD_GETATTR_NP
         pthread_getattr_np( pthread_self(), &attr );
         pthread_attr_getstack( &attr, &info->stack_base, &info->stack_size );
         pthread_attr_destroy( &attr );
+#elif defined(HAVE_PTHREAD_ATTR_GET_NP)
+        pthread_attr_t attr;
+        pthread_attr_init( &attr );
+        pthread_attr_get_np( pthread_self(), &attr );
+        pthread_attr_getstack( &attr, &info->stack_base, &info->stack_size );
+        pthread_attr_destroy( &attr );
 #elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
         char dummy;
         info->stack_size = pthread_get_stacksize_np(pthread_self());




More information about the wine-cvs mailing list