[libcxx-commits] [PATCH] D120348: [libcxx][SystemZ][ POSIX(OFF) support on z/OS
Daniel McIntosh via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 14 15:06:55 PDT 2022
DanielMcIntosh-IBM added inline comments.
================
Comment at: libcxx/src/locale.cpp:730
{
+#ifndef _LIBCPP_HAS_NO_THREADS
+ if (!__libcpp_is_threading_api_enabled()) {
----------------
zibi wrote:
> DanielMcIntosh-IBM wrote:
> > EricWF wrote:
> > > I would prefer we just use `call_once` in all cases. Why can't we do that?
> > > Presumably `call_once` needs to work when you have runtime enable/disabled threads?
> > >
> > `call_once` doesn't need to work when you threads have been disabled at runtime. As I discuss in D117372 it's actually kind of foolish to use call_once when threads have been disabled.
> >
> > We could still support it, but we'd have to make changes to `std::__call_once`. That is an option, and it's what I went with in V1 and V2, but as I discuss in D117372, I think the better option is to eventually stop using `call_once` or any other parts of the C++11 Thread Support Library in the rest of libc++.
> Will have a look at that. @DanielMcIntosh-IBM are then any plans to make changes to `call_once()` in future patches?
> Will have a look at that. @DanielMcIntosh-IBM are then any plans to make changes to `call_once()` in future patches?
Not at the moment. The plan is to apply D117372 and D117373, then leave all of the C++11 Thread Support library unsupported/UB when threads are disabled.
This gives a very clear and sensible division between what is and isn't supported, rather than some vague, best-effort system, or listing every unsupported function one at a time.
As I discuss [here](https://reviews.llvm.org/D117372#3374202), IMO this is what we should have done for `_LIBCPP_HAS_NO_THREADS`, but it might be too late for that now.
Update: it appears that `[atomic]` in the standard has been moved under `[thread]` and what was previously known as the "Thread Support Library" is now the "Concurrency support library" (see https://github.com/cplusplus/draft/commit/d74c2170a9f4c928519461d7742293af2d141852). This changes how we have to word things in documentation and comments, but that's about it. E.g. now the plan would be "When threads are disabled, support of the C++11 Concurrency Support Library will be limited to atomic operations."
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120348/new/
https://reviews.llvm.org/D120348
More information about the libcxx-commits
mailing list