Another one of those platform-dependent methods which should live behind the threading API.
Same comment as D29818
I really don't like this change (and D29818) because they start to include a ton of extra headers, and because they lift complex configuration logic into what should be a very simple header.
These functions are much better suited to being define out-of-line for a number of reasons.
Is there another way we can allow "external implementations" of these functions without lifting everything into a header?
Different take on the patch: Externalize this function only for the externally-thread-api variant.
This is much less intrusive. Note that I haven't added the declaration of __libcpp_thread_hw_concurrency() into __threading_support because it doesn't belong there (needs to be provided through a custom __external_threading header instead).
There is no easy way to test this apart from building an actual external-thread-api libc++ variant. We could do some form of testing with the external-thread-library configuration, but it still requires some not-so-pretty changes that is probably best avoided.