Hold the thread lock in a timer callback