fix bug: using ctime in multithread is not safe.