[libcxx-commits] [PATCH] D116712: [libc++] [test] Remove `UNSUPPORTED: stdlib=msvc` from lock.pass.cpp

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 6 09:27:51 PST 2022


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp:103-107
         L0 l0;
         L1 l1;
         std::lock(l0, l1);
         assert(l0.locked());
         assert(l1.locked());
----------------
@BillyONeal: Oh, I think I see what you mean. This test isn't conforming, right? Because here type `L1` has a `try_lock` method that literally never succeeds. So this test might reasonably spin forever, spinning trying to lock `L1 l1` via `try_lock` and never succeeding. The only reason it "works" with libc++ (and presumably now MSVC) is that when `l1.try_lock()` fails, we unlock everything and start over with a blocking `l1.lock()` (which happens to succeed).
I'll adjust the comment, but also, gross. :P


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116712



More information about the libcxx-commits mailing list