This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add a class "Atomic" as a simple equivalent of std::atomic.
ClosedPublic

Authored by sivachandra on Feb 27 2022, 8:28 PM.

Details

Summary

Only the methods currently required by the libc have been added.
Most of the existing uses of atomic operations have been switched over
to this new class. A future change will clean up the rest of uses.

This change now allows building mutex and condition variable code with a
C++ compiler which does not have stdatomic.h, for example g++.

Diff Detail

Event Timeline

sivachandra created this revision.Feb 27 2022, 8:28 PM
sivachandra requested review of this revision.Feb 27 2022, 8:28 PM

Add the unit test files which were missed in the previous upload.

lntue added inline comments.Feb 28 2022, 6:52 AM
libc/include/llvm-libc-types/mtx_t.h
13

__aarch64__

lntue accepted this revision.Feb 28 2022, 10:48 AM
This revision is now accepted and ready to land.Feb 28 2022, 10:48 AM