Use thread timer instead of signal.