Annotation idea: WritesGuardedBy
Open
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
### Description of the problem / feature request:
`WritesGuardedBy` annotation for fields that should be only written when a lock is held, but there can be reads outside of critical section. Example use: double-checked locking pattern.
### Feature requests: what underlying problem are you trying to solve with this feature?
Provide a way to concisely express "this variable is updated/stored (lazily) within double-checked locking" in code. Add a tool to improve the safety of such patterns (nobody will be able to accidentally write to the field outside a critical section).
### Have you found anything relevant by searching the web?
No
Contributor guide
Assessment
This issue has not been assessed yet.