[patch] libstdc++/64847 add autoconf checks for pthread_rwlock_t

Jonathan Wakely jwakely@redhat.com
Thu Mar 12 19:17:00 GMT 2015


I assumed that Pthreads was enough to ensure pthread_rwlock_t but
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64847 shows that isn't
true for HPUX (seems it was optional prior to POSIX 1003.1-2001).

This adds an autoconf check to decide whether to use pthread_rwlock_t
or the fallback implementation in terms of std::condition_variable and
std::mutex.

This also includes some fixes from Torvald so that we loop and retry
if libc returns EAGAIN, to handle a difference in semantics between
POSIX and C++14.

And as an optimization I've made the _M_rwlock member use the
PTHREAD_RWLOCK_INITIALIZER macro if available.

Tested x86_64-linux, ppc64le-linux and x86_64-dragonfly.

I plan to commit this to trunk tomorrow.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 4821 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20150312/4eeded87/attachment.bin>


More information about the Libstdc++ mailing list