[libcxx-commits] [PATCH] D110093: [NFC][libcxxabi] In cxa_guard, split the InitByte classes into InitByte... and ...Guard

Daniel McIntosh via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 20 11:49:37 PDT 2021


DanielMcIntosh-IBM created this revision.
DanielMcIntosh-IBM added reviewers: ldionne, EricWF.
DanielMcIntosh-IBM requested review of this revision.
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++abi.

We split each of the InitByteNoThreads, InitByteGlobalMutex, and
InitByteFutex classes into 2 different classes. The three new classes
NoThreadsGuard, GlobalMutexGuard, and FutexGuard replace the old
classes, and the old classes now focus only on providing functions for
managing reads/writes to the init byte. That is, the definitions of
acquire_init_byte, release_init_byte, and abort_init_byte remain in the
old classes, but nothing else.

The new classes are then responsible for everything else: dividing up
the raw guard object, providing cxa_guard_acquire/release/abort (by
inheriting from GuardObject), etc.

This is the third of 5 changes to overhaul cxa_guard.
See D108343 <https://reviews.llvm.org/D108343> for what the final result will be and more details on why
cxa_guard is getting overhauled.

Depends on D110088 <https://reviews.llvm.org/D110088>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110093

Files:
  libcxxabi/src/cxa_guard_impl.h
  libcxxabi/test/guard_test_basic.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110093.373679.patch
Type: text/x-patch
Size: 16120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210920/4e6eaf4f/attachment-0001.bin>


More information about the libcxx-commits mailing list