llvm-project/clang/lib
Anna Zaks c154f7bc37 [analyzer] Add a checker that detects blocks in critical sections
This checker should find the calls to blocking functions (for example: sleep, getc, fgets,read,recv etc.) inside a critical section. When sleep(x) is called while a mutex is held, other threads cannot lock the same mutex. This might take some time, leading to bad performance or even deadlock.

Example:

mutex_t m;

void f() {
  sleep(1000); // Error: sleep() while m is locked! [f() is called from foobar() while m is locked]
  // do some work
}

void foobar() {
  lock(m);
  f();
  unlock(m);
}

A patch by zdtorok (Zoltán Dániel Török)!

Differential Revision: https://reviews.llvm.org/D21506

llvm-svn: 282011
2016-09-20 20:28:50 +00:00
..
ARCMigrate [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
AST [cleanup] Remove excessive padding from TextTokenRetokenizer::Position 2016-09-20 18:32:48 +00:00
ASTMatchers Add an AST matcher for external formal linkage. 2016-08-17 13:10:42 +00:00
Analysis [analyzer] Fix CloneDetector crash on calling methods of class templates. 2016-08-23 16:42:00 +00:00
Basic Add some MS aliases for existing intrinsics 2016-09-14 21:19:43 +00:00
CodeGen CodeGen: further merge cstring literal construction 2016-09-20 18:38:54 +00:00
Driver Remove some boilerplate comments that don't explain anything. 2016-09-20 19:45:06 +00:00
Edit [OpenCL] Generate opaque type for sampler_t and function call for the initializer 2016-07-28 19:26:30 +00:00
Format clang-format: [JS] Fix line breaks before comments when sorting imports. 2016-09-19 07:02:34 +00:00
Frontend Simplify Clang's version number configuration in CMake. 2016-09-15 22:12:26 +00:00
FrontendTool C++ Modules TS: add frontend support for building pcm files from module 2016-08-26 00:14:38 +00:00
Headers [mips] MSA intrinsics header file 2016-09-20 15:07:36 +00:00
Index Visit lambda capture inits from RecursiveASTVisitor::TraverseLambdaCapture(). 2016-08-17 14:59:53 +00:00
Lex Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-09-07 21:53:17 +00:00
Parse [SemaObjC] Be more strict while parsing type arguments and protocols 2016-09-13 20:04:35 +00:00
Rewrite [analyzer] Fix HTMLRewriter style sheets to support non-webkit browsers. 2016-09-15 16:25:42 +00:00
Sema [OpenCL] Allow half type kernel argument when cl_khr_fp16 is enabled 2016-09-19 17:11:22 +00:00
Serialization Revert "[modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition." 2016-09-14 10:05:10 +00:00
StaticAnalyzer [analyzer] Add a checker that detects blocks in critical sections 2016-09-20 20:28:50 +00:00
Tooling Recommit r281457 "Supports adding insertion around non-insertion replacements". 2016-09-19 08:40:42 +00:00
CMakeLists.txt Fix build with various feature flag combinations 2014-07-14 22:17:22 +00:00