Backport support for read/write locks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2006-12-28 19:43:15 +00:00
parent 4d6a91eef0
commit 345968e6fb
4 changed files with 199 additions and 1 deletions

View File

@@ -261,6 +261,24 @@ AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <pthread.h>],
[int foo = PTHREAD_RWLOCK_INITIALIZER;]),
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_RWLOCK_INITIALIZER], 1, [Define to 1 if your system has PTHREAD_RWLOCK_INITIALIZER.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP)
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <pthread.h>],
[int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system has PTHREAD_RWLOCK_PREFER_WRITER_NP.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for compiler atomic operations)
AC_LINK_IFELSE(
AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),