public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5476] testsuite: tsan: add fallback overload for pthread_cond_clockwait
@ 2023-11-15 1:28 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2023-11-15 1:28 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f5d94999ee6a7bd247c3d74959ebdd46334d7804
commit r14-5476-gf5d94999ee6a7bd247c3d74959ebdd46334d7804
Author: Alexandre Oliva <oliva@adacore.com>
Date: Tue Nov 14 22:16:29 2023 -0300
testsuite: tsan: add fallback overload for pthread_cond_clockwait
LTS GNU/Linux distros from 2018, still in use, don't have
pthread_cond_clockwait. There's no trivial way to detect it so as to
make the test conditional, but there's an easy enough way to silence
the fail due to lack of the function in libc, and that has nothing to
do with the false positive that this is testing against.
for gcc/testsuite/ChangeLog
* g++.dg/tsan/pthread_cond_clockwait.C: Add fallback overload.
Diff:
---
gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C b/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C
index 82d6a5c8329..b43f3ebf80e 100644
--- a/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C
+++ b/gcc/testsuite/g++.dg/tsan/pthread_cond_clockwait.C
@@ -4,6 +4,19 @@
#include <pthread.h>
+// This overloaded version should only be selected on targets that
+// don't have a pthread_cond_clockwait in pthread.h, and it will wait
+// indefinitely for the cond_signal that, in this testcase, ought to
+// be delivered.
+static inline int
+pthread_cond_clockwait (pthread_cond_t *cv,
+ pthread_mutex_t *mtx,
+ __clockid_t,
+ void const /* struct timespec */ *)
+{
+ return pthread_cond_wait (cv, mtx);
+}
+
pthread_cond_t cv;
pthread_mutex_t mtx;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-15 1:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 1:28 [gcc r14-5476] testsuite: tsan: add fallback overload for pthread_cond_clockwait Alexandre Oliva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).