Skip to content

Commit ee9625d

Browse files
committed
rule
1 parent f43e223 commit ee9625d

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CON36-C: Wrap functions that can spuriously wake up in a loop
2+
3+
This query implements the CERT-C rule CON36-C:
4+
5+
> Wrap functions that can spuriously wake up in a loop
6+
7+
8+
## CERT
9+
10+
** REPLACE THIS BY RUNNING THE SCRIPT `scripts/help/cert-help-extraction.py` **
11+
12+
## Implementation notes
13+
14+
None
15+
16+
## References
17+
18+
* CERT-C: [CON36-C: Wrap functions that can spuriously wake up in a loop](https://wiki.sei.cmu.edu/confluence/display/c)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @id c/cert/wrap-functions-that-can-spuriously-wake-up-in-loop
3+
* @name CON36-C: Wrap functions that can spuriously wake up in a loop
4+
* @description Not wrapping functions that can wake up spuriously in a conditioned loop can result
5+
* race conditions.
6+
* @kind problem
7+
* @precision very-high
8+
* @problem.severity error
9+
* @tags external/cert/id/con36-c
10+
* correctness
11+
* concurrency
12+
* external/cert/obligation/rule
13+
*/
14+
15+
import cpp
16+
import codingstandards.c.cert
17+
import codingstandards.cpp.rules.wrapspuriousfunctioninloop.WrapSpuriousFunctionInLoop
18+
19+
class WrapFunctionsThatCanSpuriouslyWakeUpInLoopQuery extends WrapSpuriousFunctionInLoopSharedQuery {
20+
WrapFunctionsThatCanSpuriouslyWakeUpInLoopQuery() {
21+
this = Concurrency2Package::wrapFunctionsThatCanSpuriouslyWakeUpInLoopQuery()
22+
}
23+
}

0 commit comments

Comments
 (0)