This week's book giveaway is in the NodeJS forum. We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line! See this thread for details.
check the following code (your code) with comments. Please read the comments in the numerated order (1-2-3-4-5-6-7)
In other words, the synchronize ensure that only a single thread can synchronize and execute inside the block. The "wait" will make the thread wait until the other thread notify it, and also release the "lock" on the synchronized object. You cannot "wait" or "notify" outside of a synchronized block.
Anyone else feel free to provide more or better details, it is not too easy to describe
Regards, Alex [ January 22, 2008: Message edited by: Alex Belisle Turcot ]
Message for you sir! I think it is a tiny ad:
global solutions you can do in your home or backyard