Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

ToolVersionCheckerDescription
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
FB.MT_CORRECTNESS.SWL_SLEEP_WITH_LOCK_HELDMethod calls

JAVA.CONCURRENCY.STARVE.BLOCKING

Blocking in Critical Section (Java)

Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
CERT.LCK09.TSHL
CERT.LCK09.TSHL2
Do not use blocking methods while holding a lock
Do not call 'Thread.sleep()
with
' while holding a lock
heldParasoft Jtest9.5TRS.TSHL, BD.TRS.TSHL
since doing so can cause poor performance and deadlocks
PVS-Studio

Include Page
PVS-Studio_V
PVS-Studio_V

V6095
Implemented

ThreadSafe
Include Page
ThreadSafe_V
ThreadSafe_V

CCE_LK_LOCKED_BLOCKING_CALLS

Implemented
SonarQube
Java Plugin
Include Page
SonarQube
Java Plugin
_V
SonarQube
Java Plugin
_V
S2276Implemented

Related Guidelines

Bibliography

 


...