зеркало из https://github.com/github/ruby.git
thread_pthread.c: Use `getpagesize()` when `pthread_attr_getguardsize` is unavailable
This is also for emscripten. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8df47f8c8d
Коммит
50700c4d3c
|
@ -2290,7 +2290,7 @@ AS_IF([test x"$enable_pthread" = xyes], [
|
|||
AC_DEFINE(NON_SCALAR_THREAD_ID)
|
||||
])
|
||||
AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
|
||||
pthread_attr_get_np pthread_attr_getstack \
|
||||
pthread_attr_get_np pthread_attr_getstack pthread_attr_getguardsize \
|
||||
pthread_get_stackaddr_np pthread_get_stacksize_np \
|
||||
thr_stksegment pthread_stackseg_np pthread_getthrds_np \
|
||||
pthread_condattr_setclock \
|
||||
|
|
|
@ -561,8 +561,12 @@ get_stack(void **addr, size_t *size)
|
|||
CHECK_ERR(pthread_attr_getstackaddr(&attr, addr));
|
||||
CHECK_ERR(pthread_attr_getstacksize(&attr, size));
|
||||
# endif
|
||||
# ifdef HAVE_PTHREAD_ATTR_GETGUARDSIZE
|
||||
CHECK_ERR(pthread_attr_getguardsize(&attr, &guard));
|
||||
*size -= guard;
|
||||
# else
|
||||
*size -= getpagesize();
|
||||
# endif
|
||||
pthread_attr_destroy(&attr);
|
||||
#elif defined HAVE_PTHREAD_ATTR_GET_NP /* FreeBSD, DragonFly BSD, NetBSD */
|
||||
pthread_attr_t attr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче