...
Blocking or lengthy operations performed within synchronized regions could result in a deadlocked or unresponsive system.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
LCK09-J | Low | Probable | High | P2 | L3 |
Automated Detection
Some static analysis tools are capable of detecting violations of this rule.
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
CodeSonar |
| FB.MT_CORRECTNESS.SWL_SLEEP_WITH_LOCK_HELD | Method calls Thread.sleep() with a lock held | ||||||
Parasoft Jtest |
| TRS.TSHL |
BD.TRS.TSHL |
Do not use blocking methods while holding a lock | |||||||||
ThreadSafe |
| CCE_LK_LOCKED_BLOCKING_CALLS | Implemented | ||||||
SonarQube |
| S2276 | Implemented |
Related Guidelines
Bibliography
...
...