diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-05-09 09:30:48 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-05-16 09:59:01 +0100 |
commit | 3b7cb33033fbe6af6c1c4ef014f7353479d1dd6b (patch) | |
tree | 5fa4d0e49ee40aaed8bfe46325a6cf8406eb554b /libstdc++-v3/configure | |
parent | 45efdda3ff6c92f948881298031779f81aad0886 (diff) | |
download | gcc-3b7cb33033fbe6af6c1c4ef014f7353479d1dd6b.zip gcc-3b7cb33033fbe6af6c1c4ef014f7353479d1dd6b.tar.gz gcc-3b7cb33033fbe6af6c1c4ef014f7353479d1dd6b.tar.bz2 |
libstdc++: Do not use pthread_mutex_clocklock with ThreadSanitizer
As noted in https://github.com/llvm/llvm-project/issues/62623 there are
no tsan interceptors for some of the new POSIX-1:202x APIs added by
https://austingroupbugs.net/view.php?id=1216 so tsan gives false
positive warnings for try_lock_for on timed mutexes.
Disable the uses of the new pthread_mutex_clocklock API when tsan is
active. This changes the semantics of the try_lock_for functions,
because it can change which clock is used for the wait. This means those
functions might be affected by system clock adjustments when tsan is
used, when they would not be affected otherwise.
Reviewed-by: Thomas Rodgers <trodgers@redhat.com>
Reviewed-by: Mike Crowe <mac@mcrowe.com>
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK): Define
_GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK in terms of _GLIBCXX_TSAN.
* configure: Regenerate.
Diffstat (limited to 'libstdc++-v3/configure')
-rwxr-xr-x | libstdc++-v3/configure | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index d4286b6..c1faebd 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -21364,7 +21364,7 @@ fi $as_echo "$glibcxx_cv_PTHREAD_MUTEX_CLOCKLOCK" >&6; } if test $glibcxx_cv_PTHREAD_MUTEX_CLOCKLOCK = yes; then -$as_echo "#define _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK 1" >>confdefs.h +$as_echo "#define _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK (_GLIBCXX_TSAN==0)" >>confdefs.h fi |