mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
30 lines
665 B
Plaintext
30 lines
665 B
Plaintext
import cpp
|
|
|
|
class MutexTypeForTest extends MutexType {
|
|
MutexTypeForTest() {
|
|
this.(Class).getName() = "Mutex7"
|
|
}
|
|
|
|
override predicate mustlockAccess(FunctionCall fc, Expr arg) {
|
|
exists(Function f |
|
|
f = fc.getTarget() and
|
|
f.getName() = "custom_l" and
|
|
f.getDeclaringType() = this and
|
|
arg = fc.getQualifier()
|
|
)
|
|
}
|
|
|
|
override predicate trylockAccess(FunctionCall fc, Expr arg) {
|
|
none()
|
|
}
|
|
|
|
override predicate unlockAccess(FunctionCall fc, Expr arg) {
|
|
exists(Function f |
|
|
f = fc.getTarget() and
|
|
f.getName() = "custom_ul" and
|
|
f.getDeclaringType() = this and
|
|
arg = fc.getQualifier()
|
|
)
|
|
}
|
|
}
|