]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/45283 (performance/30_threads/future/polling.cc fails at compile...
authorJonathan Wakely <jwakely.gcc@gmail.com>
Sat, 14 Aug 2010 20:00:55 +0000 (20:00 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 14 Aug 2010 20:00:55 +0000 (21:00 +0100)
2010-08-14  Jonathan Wakely  <jwakely.gcc@gmail.com>

PR libstdc++/45283
* testsuite/performance/30_threads/future/polling.cc: Replace calls to
shared_future::is_ready.

From-SVN: r163250

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/performance/30_threads/future/polling.cc

index 115679e5e4dac15631179c575c20b707f08c1aee..ca4d305e1b9f51762832aae9b2c173ab6baee015 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-14  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR libstdc++/45283
+       * testsuite/performance/30_threads/future/polling.cc: Replace calls to
+       shared_future::is_ready.
+
 2010-08-13  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/hashtable.h (_Hashtable<>::operator=(const
index 50d622c41a6e4fe683aa3bdea5ff70f48ecea699..83fde27100f77f1024f29f36a8497ed1c3f60e5a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #include <thread>
 #include <testsuite_performance.h>
 
+inline bool is_ready(std::shared_future<void>& f)
+{
+  return f.wait_for(std::chrono::microseconds(1));
+}
+
 void poll(std::shared_future<void> f)
 {
-  while (!f.is_ready())
+  while (!is_ready(f))
   { }
 }
 
@@ -46,7 +51,7 @@ int main()
   start_counters(time, resource);
 
   for (int i = 0; i < 1000000; ++i)
-    (void)f.is_ready();
+    (void)is_ready(f);
   p.set_value();
 
   for (int i=0; i < n; ++i)