9 Commits

Author SHA1 Message Date
Fangrui Song
7bb6bb9a1f [tsan] Replace ALIGNED with alignas
Similar to #98958.

The relands 656f617ac772c54e0bee9d499e7ca232137ddb35 , which
was reverted due to an issue in tsan_platform_mac.cpp

Pull Request: https://github.com/llvm/llvm-project/pull/98959
2024-07-16 14:35:11 -07:00
Daniel Thornburgh
434c2382f1
Revert "[tsan] Replace ALIGNED with alignas" (#99240)
Reverts llvm/llvm-project#98959
2024-07-16 14:09:50 -07:00
Fangrui Song
656f617ac7
[tsan] Replace ALIGNED with alignas
Similar to #98958.

Pull Request: https://github.com/llvm/llvm-project/pull/98959
2024-07-16 10:39:46 -07:00
Kenny Yu
1146d96096
[TSAN] Add __tsan_check_no_mutexes_held helper (#71568)
This adds a new helper that can be called from application code to
ensure that no mutexes are held on specific code paths. This is useful
for multiple scenarios, including ensuring no locks are held:

- at thread exit
- in peformance-critical code
- when a coroutine is suspended (can cause deadlocks)

See this discourse thread for more discussion:

https://discourse.llvm.org/t/add-threadsanitizer-check-to-prevent-coroutine-suspending-while-holding-a-lock-potential-deadlock/74051

This resubmits and fixes #69372 (was reverted because of build
breakage).
This also includes the followup change #71471 (to fix a land race).
2023-11-08 08:02:14 +01:00
Hans Wennborg
27156dd575 Revert "[TSAN] Add __tsan_check_no_mutexes_held helper (#69372)"
The new lit test fails, see comment on the PR. This also reverts
the follow-up commit, see below.

> This adds a new helper that can be called from application code to
> ensure that no mutexes are held on specific code paths. This is useful
> for multiple scenarios, including ensuring no locks are held:
>
> - at thread exit
> - in peformance-critical code
> - when a coroutine is suspended (can cause deadlocks)
>
> See this discourse thread for more discussion:
>
> https://discourse.llvm.org/t/add-threadsanitizer-check-to-prevent-coroutine-suspending-while-holding-a-lock-potential-deadlock/74051

This reverts commit bd841111f340a73eb23c1be70ff1be4c8a6afb0c.
This reverts commit 16a395b74d35c564f6f36ba4a167950a323badd9.
2023-11-07 16:08:01 +01:00
Kenny Yu
bd841111f3
[TSAN] Add __tsan_check_no_mutexes_held helper (#69372)
This adds a new helper that can be called from application code to
ensure that no mutexes are held on specific code paths. This is useful
for multiple scenarios, including ensuring no locks are held:

- at thread exit
- in peformance-critical code
- when a coroutine is suspended (can cause deadlocks)

See this discourse thread for more discussion:

https://discourse.llvm.org/t/add-threadsanitizer-check-to-prevent-coroutine-suspending-while-holding-a-lock-potential-deadlock/74051
2023-11-03 06:53:52 +01:00
Vitaly Buka
3b9732132d [NFC][tsan] Clang-format includes 2023-03-20 16:20:33 -07:00
Vitaly Buka
c0fa632236 Remove NOLINTs from compiler-rt
llvm-svn: 371687
2019-09-11 23:19:48 +00:00
Nico Weber
5a3bb1a4d6 compiler-rt: Rename .cc file in lib/tsan/rtl to .cpp
Like r367463, but for tsan/rtl.

llvm-svn: 367564
2019-08-01 14:22:42 +00:00