new thread wait alg