================
@@ -57,6 +61,12 @@ class BlockInCriticalSectionChecker : public 
Checker<check::PostCall> {
                                 const CallEvent &call,
                                 CheckerContext &C) const;
 
+  CritSectionMarker getCriticalSectionMarker(const CallEvent &Call,
+                                             CheckerContext &C) const;
+  const NoteTag *
+  createCriticalSectionNote(const CritSectionMarker &CriticalSectionBegin,
+                            CheckerContext &C) const;
----------------
balazske wrote:

I do not know if it is sufficient to store the set of all found lock calls 
until the last unlock happens. Probably in the following situation it does not 
work:
```
std::mutex m, n, k;
m.lock();
n.lock();
n.unlock();
k.lock();
k.unlock();
sleep(1);
m.unlock();
```
It looks better to store all locked mutex objects somehow (not the lock calls), 
and remove one at unlock. Then the mutex counter is not needed.

https://github.com/llvm/llvm-project/pull/80029
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to