Why is it not a good practice to synchronize on Boolean?
I am not able to understand the reason why we should “never synchronize on Boolean” You should always synchronize on a constant object instance. If you synchronized on any object that you are assigning (i.e. changing the object to a new object) then it is not constant and different threads will be synchronizing on different … Read more