modify signal handling.

Modify signal handling from asynchronous signal handler to synchronous signal handling thread.

To respect async-signal-safe.

What do you expect by sending these two signals?