Sample code that checks to see if a thread has died