Yes, marking the method as synchronized and synchronizing the whole method body on this object has exactly the same result. And always when you return from a synchronized method or a synchronized block, the lock is released, no matter if it's a normal return or an exception.
This thread has been viewed 811 times.
All times above are in ranch (not your local) time.
The current ranch time is Sep 25, 2018 18:30:14.