There is really no good way to kill a thread peacefully.  The best is to have a volatile variable that stores the alive state, and a cancellation method that flips the variable.