add function t o stop thread

add function:stop thread and  when the thread works,enble the
condation's ui