std::atomic is, for the most part, just a thin veneer on top of compiler
builtins. Hence, it should be available even when threads are not available
on the system, and in fact there has been requests for such support.
This patch:
- Moves __libcpp_thread_poll_with_backoff to its own header so it can be used in <atomic> when threads are disabled.
- Adds a dummy backoff policy for atomic polling that doesn't know about threads.
- Adjusts the <atomic> feature-test macros so they are provided even when threads are disabled.
- Runs the <atomic> tests when threads are disabled.
rdar://77873569
Do we know why this constraint on having atomics only when threads are enabled was put in place?