There are lots of questions on locking, I think, and I think it is appropriate to point people to the most approapriate solution looked for by Sun in the scope of their requirements of "wasting no cycles"...
People familiar with this concept will know that wasting no cycles does in fact mean that the notifyAll() method does not fit this requirement. (I used this method, however, and got 72/80 on locking, which could be due to other mistakes...) However, if they penalize people for it or not, notifyAll() still does waste cycles.
The only way to do it is to use monitor objects in a queue and sequentially call notify() on them.
There is a second part to locking. It is unlocking. Make sure that a record is always unlocked after it is locked - even if something fails.
Anton Golovin (email@example.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]