Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question for java guru

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
HOping someone could tell if execution i catch statement blocks remain synchronised, as in the following code?
synchronise (object) {
try {

//do something

} catch (Exception1 e1) {
//do soemthing here
//is it still synchronised

} catch (Exception1 e1) {
//do soemthing here
//is it still synchronised

}
}

Would be gratefull if you could also point me to an official source that clarifies this. Also, are ther any general issues, best practices etc.. to conisder in the above code example??
Thanks,
Richard Walter
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,
Everything inside synchronized block is synchronized and so are the catch statements.
 
Maciej Kolodziej
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
And oh, You wanted some source. I recommend Thinking in Java second edition. Synchronization is described in chapter 14.
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I am closing this discussion. Please refer to this duplicate thread for answers and continued conversation.
[ February 15, 2002: Message edited by: Ajith Kallambella ]
    Bookmark Topic Watch Topic
  • New Topic