added extra sema_up at the end of timer_sleep()