Make rwlock try and timed functions optional.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Tue, 28 Feb 2012 15:52:07 +0000 (16:52 +0100)
committerMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Tue, 28 Feb 2012 15:52:07 +0000 (16:52 +0100)
commit798d166a64ed88e75e2827579f6be1526d73f54f
tree486eae087a315d783ca844f79e353f3cb29563d4
parent4a98eac43e7ad36c32f2feacf261ddcec81b20e9
Make rwlock try and timed functions optional.

* configure.ac: Check for pthread_rwlock_rdlock, pthread_rwlock_wrlock,
pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock,
pthread_rwlock_tryrdlock, pthread_rwlock_trywrlock.
* src/npth.c (trylock_func_t): New type.
(busy_wait_for): New function.
(npth_mutex_timedlock) [!HAVE_PTHREAD_MUTEX_TIMEDLOCK]: Reimplement
in terms of busy_wait_for.
(npth_rwlock_rdlock, npth_rwlock_timedrdlock)
[!HAVE_PTHREAD_RWLOCK_TRYRDLOCK]: Skip trylock.
(npth_rwlock_wrlock, npth_rwlock_timedwrlock)
[!HAVE_PTHREAD_RWLOCK_TRYWRLOCK]: Skip trylock call.
(npth_rwlock_timedrdlock) [!HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK]:
Use busy_wait_for.
(npth_rwlock_timedwrlock) [!HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK]:
Use busy_wait_for.
configure.ac
src/npth.c