| Author |
Synchronized and exceptions
|
Chris Bicnal
Ranch Hand
Joined: Aug 17, 2005
Posts: 71
|
|
Hi everyone,
I've been out of the game for a while so wanted to run something by you all. Let's say we have the following code...
..in that instance, what happens to the lock on the object object if a were to equal b?
Thanks,
Chris
|
 |
Fernando Franzini
Ranch Hand
Joined: Jan 09, 2009
Posts: 445
|
|
|
The object will be released no matter how it happend...ie by throw exception or by end of execution synchronized block.
|
Fernando Franzini - Java Blog
|
 |
Chris Bicnal
Ranch Hand
Joined: Aug 17, 2005
Posts: 71
|
|
Good stuff, that's what I thought although I wanted to make sure!
Thanks!
Chris
|
 |
 |
|
|
subject: Synchronized and exceptions
|
|
|