]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Tweak TSan annotations for std::atomic<shared_ptr<T>>
authorJonathan Wakely <jwakely@redhat.com>
Thu, 15 Sep 2022 15:57:30 +0000 (16:57 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 28 Mar 2023 22:16:44 +0000 (23:16 +0100)
commit45249f88c98d0fcc064ffce8be46f1a8643c2faa
tree52794483b0a041b202c0e4f0412b2be57f092b85
parent0cec4e9cd44e257b159a28c44d3c215fe51dbbe9
libstdc++: Tweak TSan annotations for std::atomic<shared_ptr<T>>

Do not use the __tsan_mutex_not_static flag for annotation functions
where it's not a valid flag.  Also use the try_lock and try_lock_failed
flags to more precisely annotate the CAS loop used to acquire a lock.

libstdc++-v3/ChangeLog:

* include/bits/shared_ptr_atomic.h (_GLIBCXX_TSAN_MUTEX_PRE_LOCK):
Replace with ...
(_GLIBCXX_TSAN_MUTEX_TRY_LOCK): ... this, add try_lock flag.
(_GLIBCXX_TSAN_MUTEX_TRY_LOCK_FAILED): New macro using
try_lock_failed flag
(_GLIBCXX_TSAN_MUTEX_POST_LOCK): Rename to ...
(_GLIBCXX_TSAN_MUTEX_LOCKED): ... this.
(_GLIBCXX_TSAN_MUTEX_PRE_UNLOCK): Remove invalid flag.
(_GLIBCXX_TSAN_MUTEX_POST_UNLOCK): Remove invalid flag.
(_Sp_atomic::_Atomic_count::lock): Use new macros.

(cherry picked from commit ecbdfa8b314e2c17da17511b86371f552bffd441)
libstdc++-v3/include/bits/shared_ptr_atomic.h
This page took 0.058072 seconds and 6 git commands to generate.