Explain.
Clarify condition, thanks bertm
Rewrite wait loop, clarify, may work better if several threads trying to lock the same RAF.