royale-compiler icon indicating copy to clipboard operation
royale-compiler copied to clipboard

Double-Checked Locking

Open QiAnXinCodeSafe opened this issue 5 years ago • 3 comments

https://github.com/apache/royale-compiler/blob/6f75df78d08d3c4a7f81a8d25d96b978972ee480/compiler/src/main/java/org/apache/royale/compiler/internal/scopes/ASScopeCache.java#L224-L232

Double-Checked Locking is widely cited and used as an efficient method for implementing lazy initialization in a multithreaded environment. Unfortunately, it will not work reliably in a platform independent way when implemented in Java, without additional synchronization.

QiAnXinCodeSafe avatar Oct 12 '20 09:10 QiAnXinCodeSafe

Hi, thanks for the information. Could you please let us know as a better way of doing it submitting a patch. We'll be glad to integrate any improvement. thanks

carlosrovira avatar Oct 12 '20 15:10 carlosrovira

Hi, thanks for the information. Could you please let us know as a better way of doing it submitting a patch. We'll be glad to integrate any improvement. thanks Modify the variable map with volatile.

QiAnXinCodeSafe avatar Oct 15 '20 07:10 QiAnXinCodeSafe

Hi @QiAnXinCodeSafe, if you can submit a Pull Request it would be better and would make your collaborations and out testing more productive. Could you send as a PR for this issue? thanks

carlosrovira avatar Oct 15 '20 11:10 carlosrovira