Commit 489b7629 authored by Brian Wellington's avatar Brian Wellington

- if pthreads are not found, build a nonthreaded version

- check for pthread_attr_getstacksize
parent b6ec7aff
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acconfig.h,v 1.29 2000/09/22 18:52:32 bwelling Exp $ */
/* $Id: acconfig.h,v 1.30 2000/12/22 20:50:01 bwelling Exp $ */
/***
*** This file is not to be included by any public header files, because
......@@ -111,3 +111,6 @@ int sigwait(const unsigned int *set, int *sig);
/* define if the system has a random number generating device */
#undef PATH_RANDOMDEV
/* define if pthread_attr_getstacksize() is available */
#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
......@@ -16,7 +16,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.h.in,v 1.38 2000/09/22 18:52:34 bwelling Exp $ */
/* $Id: config.h.in,v 1.39 2000/12/22 20:50:02 bwelling Exp $ */
/***
*** This file is not to be included by any public header files, because
......@@ -123,6 +123,9 @@ int sigwait(const unsigned int *set, int *sig);
/* define if the system has a random number generating device */
#undef PATH_RANDOMDEV
/* define if pthread_attr_getstacksize() is available */
#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
......
......@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.199 $)
AC_REVISION($Revision: 1.200 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
......@@ -377,12 +377,18 @@ Please install the devel/unproven-pthreads package and rerun configure.
;;
*)
AC_CHECK_LIB(pthread, pthread_create,,
AC_CHECK_LIB(pthread, __pthread_create)
AC_CHECK_LIB(pthread, __pthread_create_system)
AC_CHECK_LIB(pthreads, pthread_create))
AC_CHECK_LIB(pthread, __pthread_create,,
AC_CHECK_LIB(pthread, __pthread_create_system,,
use_threads=false)))
;;
esac
fi
#
# We may have failed to find libpthread, so check again.
#
if $use_threads
then
#
# We'd like to use sigwait() too
#
......@@ -394,6 +400,9 @@ Please install the devel/unproven-pthreads package and rerun configure.
AC_DEFINE(HAVE_SIGWAIT),))
)
AC_CHECK_FUNC(pthread_attr_getstacksize,
AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
#
# Additional OS-specific issues related to pthreads and sigwait.
#
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: thread.c,v 1.7 2000/08/01 01:31:01 tale Exp $ */
/* $Id: thread.c,v 1.8 2000/12/22 20:50:05 bwelling Exp $ */
#include <config.h>
......@@ -36,6 +36,7 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
pthread_attr_init(&attr);
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
ret = pthread_attr_getstacksize(&attr, &stacksize);
if (ret != 0)
return (ISC_R_UNEXPECTED);
......@@ -45,6 +46,7 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
if (ret != 0)
return (ISC_R_UNEXPECTED);
}
#endif
ret = pthread_create(thread, &attr, func, arg);
if (ret != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment