A global lock has been added to protect the signal processing. So when a signal it triggered, only one thread will catch it.