wait function

A function that blocks the execution of the calling thread until a specified set of conditions has been met.