imporve the thread safety of TimerQueue