From: Jonathan Wakely Date: Fri, 9 Jan 2015 14:40:16 +0000 (+0000) Subject: re PR libstdc++/60966 (std::call_once sometime hangs) X-Git-Tag: releases/gcc-4.8.5~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbb995f3c5a585d86250cb330d19d2f3f256de7b;p=thirdparty%2Fgcc.git re PR libstdc++/60966 (std::call_once sometime hangs) PR libstdc++/60966 * include/std/future (packaged_task::operator()): Increment the reference count on the shared state until the function returns. From-SVN: r219393 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ce676930cb86..b266521bc95e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2015-01-09 Jonathan Wakely + + PR libstdc++/60966 + * include/std/future (packaged_task::operator()): Increment the + reference count on the shared state until the function returns. + 2014-12-19 Release Manager * GCC 4.8.4 released. diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index 507c395eca80..26df9949de56 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -1417,7 +1417,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(_ArgTypes... __args) { __future_base::_State_base::_S_check(_M_state); - _M_state->_M_run(std::forward<_ArgTypes>(__args)...); + auto __state = _M_state; + __state->_M_run(std::forward<_ArgTypes>(__args)...); } void