PausableThread

sharing my implementation of a pausable thread.