add simulate timer
change pthread_singal to pthread_broadcast to avoid deadlock