Double Checked Locking
After warning someone about the problems of double checked locking I discovered it’s been fixed in Java 5. Simply add the volatile keyword and it’s all good.
See Wikipedia for all the details.
After warning someone about the problems of double checked locking I discovered it’s been fixed in Java 5. Simply add the volatile keyword and it’s all good.
See Wikipedia for all the details.
Not the most efficient version (the common code path is slower than it should), but works indeed.