thread_exit()s changed to exit(-1)