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