loader/pthread: Added pthread_attr_get_np support.

This commit is contained in:
Tijl Coosemans 2006-08-05 23:31:07 +02:00 committed by Alexandre Julliard
parent 72b940e09b
commit fc8172f7ee
5 changed files with 21 additions and 0 deletions

4
configure vendored
View File

@ -8337,6 +8337,7 @@ done
for ac_header in \
@ -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

View File

@ -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 @@ AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
dnl **** Check for pthread functions ****
WINE_CHECK_LIB_FUNCS(\
pthread_attr_get_np \
pthread_getattr_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np,

View File

@ -521,6 +521,9 @@
/* 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 @@
/* 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

View File

@ -29,6 +29,9 @@ struct wine_pthread_callbacks;
#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;

View File

@ -70,6 +70,12 @@ static void init_thread( struct wine_pthread_thread_info *info )
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());