Jul 25, 2007 #1 ariak Programmer Joined Jul 25, 2007 Messages 2 Location 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 }
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 }
Jul 25, 2007 #2 timw Programmer Joined May 3, 2000 Messages 1,264 Location GB Yes, the lock is released. Tim Upvote 0 Downvote
Jul 25, 2007 Thread starter #3 ariak Programmer Joined Jul 25, 2007 Messages 2 Location US Excellent, that tiny premise probably saved me from redesigning my code. Thank you. Upvote 0 Downvote