llvm-project/clang/test/Analysis/Inputs/system-header-simulator-cxx-std-locks.h
flovent 9d487050a1
[clang][analyzer] Teach the BlockInCriticalSectionChecker about O_NONBLOCK streams (#127049)
this PR close #124474 
when calling `read` and `recv` function for a non-block file descriptor
or a invalid file descriptor(`-1`), it will not cause block inside a
critical section.
this commit checks for non-block file descriptor assigned by `open`
function with `O_NONBLOCK` flag.

---------

Co-authored-by: Balazs Benics <benicsbalazs@gmail.com>
2025-02-17 15:35:40 +01:00

14 lines
205 B
C++

#pragma clang system_header
namespace std {
struct mutex {
void lock();
void unlock();
};
template <typename T> struct lock_guard {
lock_guard(std::mutex &);
~lock_guard();
};
} // namespace std