avoid polling to see if thread should return
Merge pull request #69 from michael-mri/master

avoid polling  when waiting to send ping.