On 5/19/2013 11:22 AM, deadalnix wrote:
The damn thing should have been initialized in the
first place to avoid the bug.

Sounds like you have the double-checked locking bug. Using a different value to initialize it won't fix it.

If you have a global value accessible from multiple threads, you must use synchronization. There is no way around that. If you use some other global state to check for initialization in order to avoid synchronization, you have the double checked locking bug. Yes, you do.


Reply via email to