fix the deadlock caused by not thread safe by localtime