The lock is being acquired when either thread enters the synchronized block ???
The confusing thing about this code is that it requires knowledge of javastring's and how they are intern'ed , this kind of thing should never appear in real code, you'd be more likely to find it in a java quiz or the like i.e. don't use "a" or any other string literal as your lock.
Post by:autobot
I like tacos! And this tiny ad:
a bit of art, as a gift, that will fit in a stocking