The check searches for:
- C++ synchronization primitives
- C11 synchronization primitives
- POSIX synchronization primitives
- some POSIX blocking functions
- some blocking Linux syscalls
- some Boost.Thread synchronization primitives
The preemptive functions/types can be separated into the following categories:
- explicit sleep(3)-like functions
- sleeping/waiting synchronization primitives
There are AST matchers for both sync primitives creation and blocking methods calls - we want
the former for user-created mutexes and the latter for mutex usage passed from outside (e.g. via
library global variable or a function parameter).
A simplified version of the check is used in Yandex.Taxi for coroutine code.
The check doesn't include the following:
- Io and filesystem operations. It will be included in a separate checker concurrency-async-fs as a user might have a different policy (e.g. no FS thread pool, so nothing can be improved).
- Creation of new threads. Same here, will be implemented in concurrency-async-no-new-threads, it is OK for some projects and must be changed to async code in others.
- Check for atomic::is_always_lock_free - will be implemented in future patches.
Please remove empty line between methods. See other checks as example. Same below.