I saw this in a Heinz Kabutz Java Specialist news release and, although all the articles (and indeed all) of Dr. Kabutz’s articles are well explained and detailed, he seemed to be silent about what this code does, or more importantly:
public class SomeObject { private Object lock1; private Object lock2; public void doSomething() { synchronized(lock1) { synchronized(lock2) {
What are the consequences of nested synchronized blocks? How does this affect the various threads trying to do doSomething() ?
java multithreading concurrency
IAmYourFaja Apr 28 '12 at 15:53 2012-04-28 15:53
source share