libstdc++: Fix call to __glibcxx_rwlock_init (PR 93244)
authorJonathan Wakely <jwakely@redhat.com>
Fri, 6 Mar 2020 12:03:17 +0000 (12:03 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 6 Mar 2020 12:03:17 +0000 (12:03 +0000)
commitb0815713a32c5cc062bd41fa75dac4d4408215fb
tree1aacb47c4f20e4437759331cd43eea3500916820
parent068fe0a9e9910ea795229d65b094757633e84524
libstdc++: Fix call to __glibcxx_rwlock_init (PR 93244)

When the target doesn't define PTHREAD_RWLOCK_INITIALIZER we use a
wrapper around pthread_wrlock_init, but the wrapper only takes one
argument and we try to call it with two.

This went unnnoticed on most targets because they do define the
PTHREAD_RWLOCK_INITIALIZER macro, but it causes a bootstrap failure on
darwin8.

PR libstdc++/93244
* include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
(__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
second argument to __glibcxx_rwlock_init.
* testsuite/30_threads/shared_timed_mutex/94069.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/shared_mutex
libstdc++-v3/testsuite/30_threads/shared_timed_mutex/94069.cc [new file with mode: 0644]