I assume we know that we will be running only one thread here? Otherwise we might get race conditions here, and ``pthread_once`` would be more appropriate.