[libcxx-commits] [PATCH] D68480: Implementation of C++20's P1135R6 for libcxx

Olivier Giroux via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 17 19:43:16 PDT 2019


__simt__ updated this revision to Diff 225563.
__simt__ added a comment.

Refactored the semaphores into layers that each do one clear thing, and dispensed with a lot of #ifdefs. Moved as much semaphore code as possible out of the header and into the dylib.

Refactored the atomic code which previously necessitated type punning so it no longer does that, and narrowed the declarations of the contention state type. Made use of private contention state in the internal libcxx types that make use of wait/notify so they don't create contention with the user's uses of wait/notify.

Refactored some of the classes which previously used public inheritance of interface members, to use containment of the base type and forwarding member calls instead. This also let me simplify the bases to only define the core functionality and put the sugars on the one user interface type.

Removed asserts and alignas, and fixed several names which were not reserved before.

Fixed some issues MichaƂ pointed out.

Fixed bugs where semaphores would randomly assert on __APPLE__.

Fixed bugs where semaphores would randomly fail timed waits on __linux__.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68480/new/

https://reviews.llvm.org/D68480

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/__threading_support
  libcxx/include/atomic
  libcxx/include/barrier
  libcxx/include/chrono
  libcxx/include/cstddef
  libcxx/include/latch
  libcxx/include/module.modulemap
  libcxx/include/semaphore
  libcxx/include/stdexcept
  libcxx/include/type_traits
  libcxx/src/CMakeLists.txt
  libcxx/src/atomic.cpp
  libcxx/src/barrier.cpp
  libcxx/src/semaphore.cpp
  libcxx/test/libcxx/double_include.sh.cpp
  libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
  libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
  libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
  libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
  libcxx/test/std/thread/thread.barrier/completion.pass.cpp
  libcxx/test/std/thread/thread.barrier/version.pass.cpp
  libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
  libcxx/test/std/thread/thread.latch/count_down.pass.cpp
  libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
  libcxx/test/std/thread/thread.latch/version.pass.cpp
  libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
  libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
  libcxx/test/std/thread/thread.semaphore/max.pass.cpp
  libcxx/test/std/thread/thread.semaphore/release.pass.cpp
  libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
  libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp
  libcxx/test/std/thread/thread.semaphore/version.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68480.225563.patch
Type: text/x-patch
Size: 79328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191018/cfa4d582/attachment-0001.bin>


More information about the libcxx-commits mailing list