Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning in the Middle of Synchronized Block

Status
Not open for further replies.

ariak

Programmer
Jul 25, 2007
2
US
Hi,

What would happen if the code returns in the middle of the synchronized block? Does the lock for the object be released? i.e.

synchronized (obj) {
if (/* condition */) {
return;
}
// Other stuff
}
 
Excellent, that tiny premise probably saved me from redesigning my code. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top