1 # TODO(csilvers): it would be better to actually try to link against
2 # -pthreads, to make sure it defines these methods, but that may be
3 # too hard, since pthread support is really tricky.
5 # Check for support for pthread_rwlock_init() etc.
6 # These aren't posix, but are widely supported. To get them on linux,
7 # you need to define _XOPEN_SOURCE first, so this check assumes your
8 # application does that.
10 # Note: OS X (as of 6/1/06) seems to support pthread_rwlock, but
11 # doesn't define PTHREAD_RWLOCK_INITIALIZER. Therefore, we don't test
12 # that particularly macro. It's probably best if you don't use that
13 # macro in your code either.
16 [AC_CACHE_CHECK(support for pthread_rwlock_* functions,
20 AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
21 #include <pthread.h>],
22 [pthread_rwlock_t l; pthread_rwlock_init(&l, NULL);
23 pthread_rwlock_rdlock(&l);
25 ac_rwlock=yes, ac_rwlock=no)
28 if test "$ac_rwlock" = yes; then
29 AC_DEFINE(HAVE_RWLOCK,1,[define if the compiler implements pthread_rwlock_*])