fix scheduler_dequeue_thread bug