keep pthread_once_t global with the shared state.