Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Someone apparently disliked this comment, but check out

http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLo.... Scroll down to "Fixing Double-Checked Locking using Volatile." It's five lines of code without braces, and can be applied without any creativity or reasoning.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: