Add statement to let current thread join the scheduler thread.