]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/60966 (std::call_once sometime hangs)
authorJonathan Wakely <jwakely@redhat.com>
Fri, 9 Jan 2015 14:40:16 +0000 (14:40 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 9 Jan 2015 14:40:16 +0000 (14:40 +0000)
PR libstdc++/60966
* include/std/future (packaged_task::operator()): Increment the
reference count on the shared state until the function returns.

From-SVN: r219393

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/future

index ce676930cb86ae7edb058da335494d1eb796cb17..b266521bc95e593d8d451672ab13520f5e758feb 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-09  Jonathan Wakely  <jwakely@redhat.com>
+
+       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.
index 507c395eca80d43d74e5a30ec5deff6b0c0bbeb9..26df9949de56044f2fa2d9480d2efd226c22cf9a 100644 (file)
@@ -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