This patch builds on D19412.
The motivation here is to allow toolchain vendors to build a version of libcxx with all the underlying os threading mechanics differed to runtime - sacrificing some performance for flexibility.
This API (_LIBCPP_THREAD_API_EXTERNAL) currently only works when libcxx is build as a static library. This is because the shared library builds pass -z defs linker flag, which disallows undefined symbols in the library. I'm not familiar with shared library limitations on specific platforms, but in theory, this could work on shared library builds as well.
Currently there are quite a lot of test failures because the testing infrastructure need to be updated to provide an implementation of this threading API (pthreads will do). Our plan is to hide this whole extension under some cmake variable at some point.
Before putting more effort into this, I thought of checking if the community if open to this kind of an API. Of course, we (ARM) will be committed to maintaining this API in the long run.
I would rather the new branch be used across the board. I don't like littering the generic implementation files with preprocessor blocks everywhere.
Stated differently, get rid of
and just use
everywhere instead.