You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the class ThreadSafeSingleton.java at path design-patterns/java/singleton/ThreadSafeSingleton.java
I could see that the below statement is missing the volatile keyword.
private static ThreadSafeSingleton instance;
Although we are breaking the contention using synchronized method, ongoing threads that try to access this method might still see that instance == null even after it has been instantiated.
From the class ThreadSafeSingleton.java at path design-patterns/java/singleton/ThreadSafeSingleton.java
I could see that the below statement is missing the volatile keyword.
private static ThreadSafeSingleton instance;
Although we are breaking the contention using synchronized method, ongoing threads that try to access this method might still see that
instance == null
even after it has been instantiated.CC : @ashishps1
The text was updated successfully, but these errors were encountered: