This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][SystemZ][z/OS] added internal_threading_support.h
AbandonedPublic

Authored by DanielMcIntosh-IBM on Jan 14 2022, 5:11 PM.

Details

Reviewers
ldionne
Mordante
Quuxplusone
Group Reviewers
Restricted Project
Restricted Project
Summary

This is a different approach to adding support for z/OS POSIX(OFF) based on the suggestions in D110349.
However, since z/OS still needs to use the pthread version of the __threading_support API, instead of _LIBCPP_HAS_THREAD_API_EXTERNAL we implement something very close to _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL.

We couldn't quite use _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL for two reasons: First, we only want to affect libcxx's internal uses of __threading_support (i.e. those inside libcxx/src not libcxx/include). Second, we don't want to affect anything in the C++11 Threading Support Library, since the user shouldn't be using that anyways if the base threading support library (e.g. pthread) isn't available.

This is the 4th of 4 changes to add support for POSIX(OFF) on z/OS.
See D117366 for more background, and D110349 for discussion of an alternative implementation.

Depends on D117370, D117372, D117373

Diff Detail

Event Timeline

DanielMcIntosh-IBM requested review of this revision.Jan 14 2022, 5:11 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 14 2022, 5:11 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
DanielMcIntosh-IBM edited the summary of this revision. (Show Details)

Remove documentation update (and move to D117372, since it's more appropriate there)

libcxx/src/include/internal_threading_support.h
264–275

To me, this is horrendous, and a very strong reason to prefer what I proposed in D113054. Even if we go with the approach outlined in this PR for everything else except exception storage, I think that at the very least the runtime-dependent threading changes should be allowed to creep out of internal_threading_support.h and into cxa_exception_storage.cpp.

We may also not have any choice in the matter when adding support for a platform like AIX where __libcpp_is_threading_api_enabled() can change during program execution.

DanielMcIntosh-IBM edited the summary of this revision. (Show Details)Jan 14 2022, 6:30 PM
zibi added a subscriber: zibi.Feb 22 2022, 12:39 PM

Please see the new version in D120348.