|
SemmleCode Professional comes with a wide range of pre-packaged analyses, from architectural properties and metrics, to statement-level checks for likely bugs and violations of best practice.
Sleep with Lock Held
This query finds code that calls Thread.sleep with a lock held.
Other threads may be waiting to acquire this lock, leading to poor performance or even a deadlock.
How to Interpret the Query Results
The query flags such code and also displays the list of detected occurrences in the result view.
How to Address the Query Results
Instead, wait should be called on the lock.
Source Code
References
|