[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:36:36 PST 2022
Quuxplusone updated this revision to Diff 397920.
Quuxplusone added a comment.
Update the comment.
It feels like this test maybe shouldn't even be in `libcxx/test/std/`, but it's also our only test coverage for `std::lock` at all, and splitting it up into "conforming" and "non-conforming" pieces seems like more than I signed up for. So I'm going to resist scope creep and land this once CI is green. If someone else wants to tackle the "write good std::lock tests" task, that'd be cool.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116712/new/
https://reviews.llvm.org/D116712
Files:
libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
Index: libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
===================================================================
--- libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
+++ libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
@@ -8,10 +8,14 @@
//
// UNSUPPORTED: libcpp-has-no-threads
-// This test hangs forever when built against libstdc++ and MSVC. In order to allow
-// validation of the test suite against other STLs we have to mark it
-// unsupported.
-// UNSUPPORTED: stdlib=libstdc++, stdlib=msvc
+// This test hangs forever when built against libstdc++ (Oct 2016).
+// UNSUPPORTED: stdlib=libstdc++
+
+// This test isn't quite standards-conforming: it's testing our specific
+// algorithm, where when lx.try_lock() fails we start the next attempt
+// with an unconditional lx.lock(). Thus our algorithm can handle a list
+// of mutexes where at-most-one of them is of the evil type `class L1`,
+// but will loop forever if two or more of them are `class L1`.
// <mutex>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116712.397920.patch
Type: text/x-patch
Size: 1061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220106/a7735f90/attachment.bin>
More information about the libcxx-commits
mailing list