avoid potential for blocking in do_wait