wine_pthread_init_thread: retrieve the stack info on Darwin.

oldstable
Emmanuel Maillard 2004-07-21 03:06:03 +00:00 committed by Alexandre Julliard
parent 0b63877ed1
commit d110e1f264
4 changed files with 22 additions and 3 deletions

8
configure vendored
View File

@ -11133,7 +11133,13 @@ fi
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LIBPTHREAD"
for ac_func in pthread_getattr_np
for ac_func in \
pthread_getattr_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np \
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5

View File

@ -548,10 +548,14 @@ dnl **** Check for pthread_rwlock_t ****
AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
#include <pthread.h>])
dnl **** Check for pthread_getattr_np ****
dnl **** Check for pthread functions ****
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LIBPTHREAD"
AC_CHECK_FUNCS(pthread_getattr_np)
AC_CHECK_FUNCS(\
pthread_getattr_np \
pthread_get_stackaddr_np \
pthread_get_stacksize_np \
)
LIBS="$ac_save_LIBS"
dnl **** Check for Open Sound System ****

View File

@ -449,6 +449,12 @@
/* Define to 1 if you have the `pthread_getattr_np' function. */
#undef HAVE_PTHREAD_GETATTR_NP
/* Define to 1 if you have the `pthread_get_stackaddr_np' function. */
#undef HAVE_PTHREAD_GET_STACKADDR_NP
/* Define to 1 if you have the `pthread_get_stacksize_np' function. */
#undef HAVE_PTHREAD_GET_STACKSIZE_NP
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H

View File

@ -69,6 +69,9 @@ void wine_pthread_init_thread( struct wine_pthread_thread_info *info )
pthread_attr_t attr;
pthread_getattr_np( pthread_self(), &attr );
pthread_attr_getstack( &attr, &info->stack_base, &info->stack_size );
#elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
info->stack_size = pthread_get_stacksize_np(pthread_self());
info->stack_base = pthread_get_stackaddr_np(pthread_self());
#else
/* assume that the stack allocation is page aligned */
char dummy;