This is better than a no-op RWMutex because then the same binary works both when the application is multi-threaded and when it isn't. Therefore the build doesn't have to distinguish between the two cases.

Just to make sure I understand: pthread_create != nullptr is only going to be satisfied if pthread_create was linked into the program, _and_ it was used at least once before? I thought it would be non-null whenever it was linked into the program, whether you used it or not.

Can this be conditionalized to not happen on macOS/iOS? I can see needing this on platforms where pthreads is optional, but it looks like this code will apply to macOS too, which introduces risk there.

Given this, I think implementing a no-op RWMutex is a better solution. And if you need the ability for the same library to work in both cases, maybe this code could be in a WeakRWMutex (or something like that).