Flag code that suspends a coroutine while a lock is held.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clang-tidy/cppcoreguidelines/NoSuspendWithLockCheck.cpp | ||
---|---|---|
25–27 | add configuration option for lock types, many big project got own types or wrappers. | |
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/no-suspend-with-lock.rst | ||
14 | add info to documentation that manual locking/unlocking is not supported. | |
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/no-suspend-with-lock.cpp | ||
190 | add test with lambda, something like: std::unique_lock<std::mutex> lock(mtx); auto lambda = [] { co_yeld 0; } And add test with class defined in function with co_yeld in class, and lock in function. |
Consider ignoring template instances, to avoid generating lot of warnings for each instance.
clang-tools-extra/clang-tidy/cppcoreguidelines/NoSuspendWithLockCheck.cpp | ||
---|---|---|
25–27 | I was just thinking about this case...my code base had its own lock types that I would want to be able to include. |
clang-tools-extra/clang-tidy/cppcoreguidelines/NoSuspendWithLockCheck.cpp | ||
---|---|---|
28 | consider using matchers::matchesAnyListedName |
add configuration option for lock types, many big project got own types or wrappers.