[all-commits] [llvm/llvm-project] 6cf25d: [libc++] counting_semaphore should not be default-...

Quuxplusone via All-commits all-commits at lists.llvm.org
Fri Nov 5 07:23:38 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 6cf25deec7d0b74a073b74048ae8f7f0c69fbfee
      https://github.com/llvm/llvm-project/commit/6cf25deec7d0b74a073b74048ae8f7f0c69fbfee
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-11-05 (Fri, 05 Nov 2021)

  Changed paths:
    M libcxx/include/semaphore
    M libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
    A libcxx/test/std/thread/thread.semaphore/ctor.compile.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/max.pass.cpp

  Log Message:
  -----------
  [libc++] counting_semaphore should not be default-constructible.

Neither the current C++2b draft, nor any revision of [p1135],
nor libstdc++, claims that `counting_semaphore` should be
default-constructible. I think this was just a copy-paste issue
somehow.

Also, `explicit` was missing from the constructor.

Also, `constexpr` remains missing; but that's probably more of a
technical limitation, since apparently there are some platforms
where we don't (can't??) use the atomic implementation and
have to rely on pthreads, which obviously isn't constexpr.

Differential Revision: https://reviews.llvm.org/D110042

(cherry picked from commit c9af0e61fa85842ce280ddab8ab491de38a7ae5b)


  Commit: 00f64ccb49d9049603c0581d1ab23cee52ad8e56
      https://github.com/llvm/llvm-project/commit/00f64ccb49d9049603c0581d1ab23cee52ad8e56
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-11-05 (Fri, 05 Nov 2021)

  Changed paths:
    M libcxx/docs/ReleaseNotes.rst
    M libcxx/include/__threading_support
    M libcxx/include/semaphore
    M libcxx/src/support/win32/thread_win32.cpp
    M libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/ctor.compile.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/release.pass.cpp

  Log Message:
  -----------
  [libc++] Remove non-atomic "platform" semaphore implementations.

These can't be made constexpr-constructible (constinit'able),
so they aren't C++20-conforming. Also, the platform versions are
going to be bigger than the atomic/futex version, so we'd have
the awkward situation that `semaphore<42>` could be bigger than
`semaphore<43>`, and that's just silly.

Differential Revision: https://reviews.llvm.org/D110110

(cherry picked from commit d0eaf75320ea72c4da55060b6c42aad923870814)

CHERRY-PICK NOTE BY @ldionne:
I added a release note mentioning the ABI break.


Compare: https://github.com/llvm/llvm-project/compare/d218ef07a072...00f64ccb49d9


More information about the All-commits mailing list