mirror of https://github.com/getdnsapi/getdns.git
HAVE_PTHREAD instead of HAVE_PTHREADS like unbound
This commit is contained in:
parent
5a2ee50de3
commit
5b5123a79d
|
@ -992,7 +992,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
#---- check for pthreads library
|
#---- check for pthreads library
|
||||||
AC_SEARCH_LIBS([pthread_mutex_init],[pthread],[AC_DEFINE([HAVE_PTHREADS], [1], [Have pthreads library])], [AC_MSG_WARN([pthreads not available])])
|
AC_SEARCH_LIBS([pthread_mutex_init],[pthread],[AC_DEFINE([HAVE_PTHREAD], [1], [Have pthreads library])], [AC_MSG_WARN([pthreads not available])])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether the C compiler (${CC-cc}) supports the __func__ variable])
|
AC_MSG_CHECKING([whether the C compiler (${CC-cc}) supports the __func__ variable])
|
||||||
AC_LANG_PUSH(C)
|
AC_LANG_PUSH(C)
|
||||||
|
@ -1008,7 +1008,7 @@ dnl ----- Start of "Things needed for gldns" section
|
||||||
dnl -----
|
dnl -----
|
||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
|
|
||||||
AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h sys/select.h],,, [AC_INCLUDES_DEFAULT])
|
AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h sys/select.h endian.h],,, [AC_INCLUDES_DEFAULT])
|
||||||
|
|
||||||
dnl Check the printf-format attribute (if any)
|
dnl Check the printf-format attribute (if any)
|
||||||
dnl result in HAVE_ATTR_FORMAT.
|
dnl result in HAVE_ATTR_FORMAT.
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#define LOCKRET(func) func
|
#define LOCKRET(func) func
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
#ifdef HAVE_PTHREAD
|
||||||
#include "pthread.h"
|
#include "pthread.h"
|
||||||
|
|
||||||
static pthread_mutex_t arc_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t arc_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
|
@ -62,7 +62,7 @@ typedef unsigned short in_port_t;
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
#ifdef HAVE_PTHREAD
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -93,7 +93,7 @@ typedef unsigned short in_port_t;
|
||||||
upstream. Using 1 hour for all transports - based on RFC7858 value for for TLS.*/
|
upstream. Using 1 hour for all transports - based on RFC7858 value for for TLS.*/
|
||||||
#define BACKOFF_RETRY 3600
|
#define BACKOFF_RETRY 3600
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
#ifdef HAVE_PTHREAD
|
||||||
static pthread_mutex_t ssl_init_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t ssl_init_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
#endif
|
#endif
|
||||||
static bool ssl_init=false;
|
static bool ssl_init=false;
|
||||||
|
@ -1434,7 +1434,7 @@ getdns_context_create_with_extended_memory_functions(
|
||||||
/* Unbound needs SSL to be init'ed this early when TLS is used. However we
|
/* Unbound needs SSL to be init'ed this early when TLS is used. However we
|
||||||
* don't know that till later so we will have to do this every time. */
|
* don't know that till later so we will have to do this every time. */
|
||||||
|
|
||||||
#ifdef HAVE_PTHREADS
|
#ifdef HAVE_PTHREAD
|
||||||
pthread_mutex_lock(&ssl_init_lock);
|
pthread_mutex_lock(&ssl_init_lock);
|
||||||
#else
|
#else
|
||||||
/* XXX implement Windows-style lock here */
|
/* XXX implement Windows-style lock here */
|
||||||
|
@ -1444,7 +1444,7 @@ getdns_context_create_with_extended_memory_functions(
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
ssl_init = true;
|
ssl_init = true;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_PTHREADS
|
#ifdef HAVE_PTHREAD
|
||||||
pthread_mutex_unlock(&ssl_init_lock);
|
pthread_mutex_unlock(&ssl_init_lock);
|
||||||
#else
|
#else
|
||||||
/* XXX implement Windows-style unlock here */
|
/* XXX implement Windows-style unlock here */
|
||||||
|
|
Loading…
Reference in New Issue