Nope that's wrong, too. That would still have a race if the first thread inits and shuts down before the second thread gets to increment.

You need to do the `git_atomic_inc` but remove the `> 1` check. It should inc and then call `pthread_once` every time. Then you can safely shutdown once a `git_atomic_dec` gets to zero.

Even that has a race, now that I think about it. If a thread starts to shutdown and gets to zero then another thread races in to init again, the shutdown might proceed.

Sorry! I feel like I've been leading you astray.