Changed the way hard restart is done for better compatibility with windows pthread.