Files
codeql/csharp/ql/src/Concurrency/LockThis.ql
2019-01-02 12:59:07 +01:00

20 lines
470 B
Plaintext

/**
* @name Locking the 'this' object in a lock statement
* @description It is bad practice to lock the 'this' object because
* it might be locked elsewhere.
* @kind problem
* @problem.severity warning
* @precision high
* @id cs/lock-this
* @tags reliability
* maintainability
* modularity
* external/cwe/cwe-662
*/
import csharp
from LockStmt s, ThisAccess a
where a = s.getExpr()
select a, "'this' used in lock statement."