Added scheduler_thread_exit()