diff options
author | Jonathan Wakely <jwakely.gcc@gmail.com> | 2012-02-01 00:20:08 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2012-02-01 00:20:08 +0000 |
commit | 488b3e6573895b6c205e312e6ce3955ee9c8bd3c (patch) | |
tree | d40e1df5bc03aec565b5d676beb1c5e33137a6d8 /libstdc++-v3/src | |
parent | 3627585bcfd7d465755b9281e81e50e1867fe2a1 (diff) | |
download | gcc-488b3e6573895b6c205e312e6ce3955ee9c8bd3c.zip gcc-488b3e6573895b6c205e312e6ce3955ee9c8bd3c.tar.gz gcc-488b3e6573895b6c205e312e6ce3955ee9c8bd3c.tar.bz2 |
re PR libstdc++/49204 ([C++0x] remaining issues in <future>)
PR libstdc++/49204
* include/std/future (__future_base::_State_base::wait()): Use lambda
expression for predicate and remove redundant test.
(__future_base::_State_base::wait_for()): Return future_status and
use lambda expression for predicate.
(__future_base::_State_base::wait_until()): Likewise.
(__basic_future::wait_for(), __basic_future::wait_until()): Likewise.
(__future_base::_Async_state): Replace with _Async_state_common
class for non-dependent functionality and _Async_state_impl class
template for dependent functionality.
(__future_base::_Async_state_common::_M_join): Serialize attempts to
join thread.
(__future_base::_Async_state_common::_M_run_deferred): Join.
(__future_base::_Async_state::_M_do_run): Replace with lambda.
* src/c++11/future.cc (__future_base::_Async_state_common): Define
destructor, so key function is in the library.
* config/abi/pre/gnu.ver: Add exports for ~_Async_state_common.
* testsuite/30_threads/packaged_task/members/get_future.cc: Expect
future_status return instead of bool.
* testsuite/30_threads/shared_future/members/wait_until.cc: Likewise.
* testsuite/30_threads/shared_future/members/wait_for.cc: Likewise.
* testsuite/30_threads/future/members/wait_until.cc: Likewise.
* testsuite/30_threads/future/members/wait_for.cc: Likewise.
* testsuite/30_threads/promise/members/set_value2.cc: Likewise.
* testsuite/30_threads/promise/members/set_value3.cc: Likewise.
* testsuite/30_threads/promise/members/swap.cc: Likewise.
From-SVN: r183788
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/c++11/future.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libstdc++-v3/src/c++11/future.cc b/libstdc++-v3/src/c++11/future.cc index e68642c3..dab0774 100644 --- a/libstdc++-v3/src/c++11/future.cc +++ b/libstdc++-v3/src/c++11/future.cc @@ -1,6 +1,6 @@ // future -*- C++ -*- -// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2011, 2012 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 @@ -84,6 +84,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __future_base::_Result_base::~_Result_base() = default; __future_base::_State_base::~_State_base() = default; + + __future_base::_Async_state_common::~_Async_state_common() { _M_join(); } + + // Explicit instantiation due to -fno-implicit-instantiation. + template void call_once(once_flag&, void (thread::*&&)(), reference_wrapper<thread>&&); #endif _GLIBCXX_END_NAMESPACE_VERSION |