avoid polling to see if thread should return