Commit 73571bf1 by Jonathan Wakely Committed by Jonathan Wakely

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
parent 6d1e1a26
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
......
// 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment