Note the thread you want to wake up (careful how you do this re happens before ordering) in the completing thread somewhere that all threads can read or better still on the object being synchronized on, notify all and have all the notified threads
test for if they are the one that should wake up and if not re wait, you could embed all this logic in the object being synchronized on.
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5