aspose file tools*
The moose likes Threads and Synchronization and the fly likes exception in sync block Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "exception in sync block" Watch "exception in sync block" New topic
Author

exception in sync block

Rajani Deshpande
Ranch Hand

Joined: May 08, 2000
Posts: 45
If an exception is thrown inside a synchronized block will the lock on the object that was synchronized be automatically released?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yes. (Unless the exception is also caught inside the synhronized block.)


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception in sync block