Shouldn't we be raising an exception if we leave this loop with a non-zero wait_ctr?