Skip to content

Commit 444bced

Browse files
committed
moving some classes into the library
1 parent 0ae0c00 commit 444bced

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cpp/common/src/codingstandards/cpp/Concurrency.qll

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,3 +787,22 @@ class DestructorMutexDestroyer extends MutexDestroyer, DestructorCall {
787787
*/
788788
override Expr getMutexExpr() { getQualifier() = result }
789789
}
790+
791+
/**
792+
* Models a conditional variable denoted by `std::condition_variable`.
793+
*/
794+
class ConditionalVariable extends Variable {
795+
ConditionalVariable() {
796+
getUnderlyingType().(Class).hasQualifiedName("std", "condition_variable")
797+
}
798+
}
799+
800+
/**
801+
* Models a conditional function, which is a function that depends on the value
802+
* of a conditional variable.
803+
*/
804+
class ConditionalFunction extends Function {
805+
ConditionalFunction() {
806+
exists(ConditionalVariable cv | cv.getAnAccess().getEnclosingFunction() = this)
807+
}
808+
}

0 commit comments

Comments
 (0)