-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make JavaModelManager.PerProjectInfo a bit more thread safe
PerProjectInfo with almost all fields being public is a big mess. Every thread can access every non final field at any time without any consistency checks etc. Let make all non final fields volatile so that they read at least the latest data, even if only partially consistent. The object inconsistency may appear because most of the fields are set in PerProjectInfo.setClasspath() in a non-atomic way, so readers who don't lock on PerProjectInfo may observe partially updated PerProjectInfo object. Ideally all the fields should be made private and accessed from dedicated synchronized methods on PerProjectInfo. See #2753 (comment)
- Loading branch information
1 parent
93d46ab
commit 45f50f7
Showing
3 changed files
with
47 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters