Made time_class thread safe