[libcxx-commits] [PATCH] D154354: [libc++] Fix thread annotations on shared_mutex and shared_timed_mutex

Aaron Puchert via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 3 16:12:31 PDT 2023


aaronpuchert added a comment.

In D154354#4469777 <https://reviews.llvm.org/D154354#4469777>, @aaronpuchert wrote:

>   if (m.try_lock())
>     ++foo; // ok.
>   m.unlock();

That would generate a warning, better:

  if (m.try_lock()) {
    ++foo; // ok.
    m.unlock();
  }

And there is no point in testing for that warning, because we're doing this in Clang. We should essentially only test that we got the right attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154354



More information about the libcxx-commits mailing list