Bonjour,
Ma question est la suivante :
j'ai un block synchro avec dedans une methode qui peut lever une exception.
Si celle-ci est levee, le thread sort il du block synchro et libere il la ressource ?
Merci
ciao
Version imprimable
Bonjour,
Ma question est la suivante :
j'ai un block synchro avec dedans une methode qui peut lever une exception.
Si celle-ci est levee, le thread sort il du block synchro et libere il la ressource ?
Merci
ciao
Salut,
Oui. Dans tous les cas lorsque tu sors d'un bloc synchronized le lock est libéré :Citation:
Envoyé par _juel_
http://java.sun.com/docs/books/jls/t...nts.html#14.19
a++Citation:
If execution of the Block completes normally, then the lock is unlocked and the synchronized statement completes normally. If execution of the Block completes abruptly for any reason, then the lock is unlocked and the synchronized statement then completes abruptly for the same reason.