]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
- if pthreads are not found, build a nonthreaded version
authorBrian Wellington <source@isc.org>
Fri, 22 Dec 2000 20:50:05 +0000 (20:50 +0000)
committerBrian Wellington <source@isc.org>
Fri, 22 Dec 2000 20:50:05 +0000 (20:50 +0000)
- check for pthread_attr_getstacksize

acconfig.h
config.h.in
configure.in
lib/isc/pthreads/thread.c

index 864eedccf21fa584a3dfb0e7783b927239e795b9..32ae1bc55ba52c50905afbd7be8c0cb6939bcf8c 100644 (file)
@@ -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
index fdd4e81039e2dbe2c1629c513eaed8ab5a3298b3..dedae6249bd156ec3a0687d6a420f4335fb8b184 100644 (file)
@@ -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
 
index 2b8208060b2e08c13afc35153427b84ef7b7a5bd..0fbb6b8a23b2cf650902478dc56c0f2bd8e8026b 100644 (file)
@@ -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.
        #
index 578d3d61268fc833121e71156f333a94542f8e23..cac349f99ca6e439b35c1b19a2b44b9d3025c067 100644 (file)
@@ -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)