[PATCH] D50549: [libcxx] [test] Repair thread unsafety in thread tests

Billy Robert O'Neal III via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 18:02:17 PDT 2018


BillyONeal updated this revision to Diff 160498.
BillyONeal edited the summary of this revision.
BillyONeal added a comment.

Remove changes to detach tests.


https://reviews.llvm.org/D50549

Files:
  test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp


Index: test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
===================================================================
--- test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
+++ test/std/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp
@@ -157,8 +157,11 @@
     {
         assert(G::n_alive == 0);
         assert(!G::op_run);
-        std::thread t((G()));
-        t.join();
+        {
+            G g;
+            std::thread t(g);
+            t.join();
+        }
         assert(G::n_alive == 0);
         assert(G::op_run);
     }
@@ -185,8 +188,11 @@
     {
         assert(G::n_alive == 0);
         assert(!G::op_run);
-        std::thread t(G(), 5, 5.5);
-        t.join();
+        {
+            G g;
+            std::thread t(g, 5, 5.5);
+            t.join();
+        }
         assert(G::n_alive == 0);
         assert(G::op_run);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50549.160498.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180814/008e74a4/attachment.bin>


More information about the cfe-commits mailing list