aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2010-08-14 20:00:55 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2010-08-14 21:00:55 +0100
commit73571bf1e205b3428f404297d19b9ad936dc36a1 (patch)
treea2d070e8060b60266fc94331ddc158d19dd30a03
parent6d1e1a26d9b19fcdc8a8586f56df904a3a8e4730 (diff)
downloadgcc-73571bf1e205b3428f404297d19b9ad936dc36a1.zip
gcc-73571bf1e205b3428f404297d19b9ad936dc36a1.tar.gz
gcc-73571bf1e205b3428f404297d19b9ad936dc36a1.tar.bz2
re PR libstdc++/45283 (performance/30_threads/future/polling.cc fails at compile time)
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
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/testsuite/performance/30_threads/future/polling.cc11
2 files changed, 14 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 115679e..ca4d305 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/testsuite/performance/30_threads/future/polling.cc b/libstdc++-v3/testsuite/performance/30_threads/future/polling.cc
index 50d622c..83fde27 100644
--- a/libstdc++-v3/testsuite/performance/30_threads/future/polling.cc
+++ b/libstdc++-v3/testsuite/performance/30_threads/future/polling.cc
@@ -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
@@ -20,9 +20,14 @@
#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)