Detect a deadlock from a ConcurrentHashMap use
Open
Type-NewCheck
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
### Description of the feature request:
Detect possible deadlocks from calling CHM's method inside a lambda passed into a `compute()`-like method on the same map:
```java
ConcurrentHashMap map;
map.compute(key, (String k, Integer v) -> {
if (v == null || v == 0) {
return map.get(DEFAULT_KEY); // possible deadlock
}
return v;
});
```
See https://github.com/code-review-checklists/java-concurrency#chm-nested-calls
Contributor guide
Assessment
This issue has not been assessed yet.