View | Details | Return to bug 64735
Collapse All | Expand All

(-)a/libstdc++-v3/include/std/future (-3 / +1 lines)
Lines 183-190 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
183
    future<__async_result_of<_Fn, _Args...>>
183
    future<__async_result_of<_Fn, _Args...>>
184
    async(_Fn&& __fn, _Args&&... __args);
184
    async(_Fn&& __fn, _Args&&... __args);
185
185
186
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
186
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
187
  && (ATOMIC_INT_LOCK_FREE > 1)
188
187
189
  /// Base class and enclosing scope.
188
  /// Base class and enclosing scope.
190
  struct __future_base
189
  struct __future_base
Lines 1740-1746 _GLIBCXX_BEGIN_NAMESPACE_VERSION Link Here
1740
1739
1741
#endif // _GLIBCXX_ASYNC_ABI_COMPAT
1740
#endif // _GLIBCXX_ASYNC_ABI_COMPAT
1742
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
1741
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
1743
       // && ATOMIC_INT_LOCK_FREE
1744
1742
1745
  // @} group futures
1743
  // @} group futures
1746
_GLIBCXX_END_NAMESPACE_VERSION
1744
_GLIBCXX_END_NAMESPACE_VERSION
(-)a/libstdc++-v3/libsupc++/eh_ptr.cc (-11 / +15 lines)
Lines 23-36 Link Here
23
// <http://www.gnu.org/licenses/>.
23
// <http://www.gnu.org/licenses/>.
24
24
25
#include <bits/c++config.h>
25
#include <bits/c++config.h>
26
#include <bits/atomic_lockfree_defines.h>
27
28
#if ATOMIC_INT_LOCK_FREE > 1
29
26
30
#define _GLIBCXX_EH_PTR_COMPAT
27
#define _GLIBCXX_EH_PTR_COMPAT
31
28
32
#include <exception>
29
#include <exception>
33
#include <bits/exception_ptr.h>
30
#include <bits/exception_ptr.h>
31
#include <ext/atomicity.h>
34
#include "unwind-cxx.h"
32
#include "unwind-cxx.h"
35
33
36
using namespace __cxxabiv1;
34
using namespace __cxxabiv1;
Lines 101-107 std::__exception_ptr::exception_ptr::_M_addref() noexcept Link Here
101
    {
99
    {
102
      __cxa_refcounted_exception *eh =
100
      __cxa_refcounted_exception *eh =
103
	__get_refcounted_exception_header_from_obj (_M_exception_object);
101
	__get_refcounted_exception_header_from_obj (_M_exception_object);
104
      __atomic_add_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL);
102
      _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&eh->referenceCount);
103
      __gnu_cxx::__atomic_add_dispatch(&eh->referenceCount, 1);
104
      _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&eh->referenceCount);
105
    }
105
    }
106
}
106
}
107
107
Lines 113-122 std::__exception_ptr::exception_ptr::_M_release() noexcept Link Here
113
    {
113
    {
114
      __cxa_refcounted_exception *eh =
114
      __cxa_refcounted_exception *eh =
115
	__get_refcounted_exception_header_from_obj (_M_exception_object);
115
	__get_refcounted_exception_header_from_obj (_M_exception_object);
116
      if (__atomic_sub_fetch (&eh->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
116
      _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&eh->referenceCount);
117
      if (__gnu_cxx::__exchange_and_add_dispatch(&eh->referenceCount, -1) == 1)
117
        {
118
        {
118
	  if (eh->exc.exceptionDestructor)
119
          _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&eh->referenceCount);
119
	    eh->exc.exceptionDestructor (_M_exception_object);
120
          if (eh->exc.exceptionDestructor)
121
            eh->exc.exceptionDestructor (_M_exception_object);
120
122
121
          __cxa_free_exception (_M_exception_object);
123
          __cxa_free_exception (_M_exception_object);
122
          _M_exception_object = 0;
124
          _M_exception_object = 0;
Lines 211-218 __gxx_dependent_exception_cleanup(_Unwind_Reason_Code code, Link Here
211
213
212
  __cxa_free_dependent_exception (dep);
214
  __cxa_free_dependent_exception (dep);
213
215
214
  if (__atomic_sub_fetch (&header->referenceCount, 1, __ATOMIC_ACQ_REL) == 0)
216
  _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&header->referenceCount);
217
  if (__gnu_cxx::__exchange_and_add_dispatch(&header->referenceCount, -1) == 1)
215
    {
218
    {
219
      _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&header->referenceCount);
216
      if (header->exc.exceptionDestructor)
220
      if (header->exc.exceptionDestructor)
217
	header->exc.exceptionDestructor (header + 1);
221
	header->exc.exceptionDestructor (header + 1);
218
222
Lines 230-236 std::rethrow_exception(std::exception_ptr ep) Link Here
230
234
231
  __cxa_dependent_exception *dep = __cxa_allocate_dependent_exception ();
235
  __cxa_dependent_exception *dep = __cxa_allocate_dependent_exception ();
232
  dep->primaryException = obj;
236
  dep->primaryException = obj;
233
  __atomic_add_fetch (&eh->referenceCount, 1,  __ATOMIC_ACQ_REL);
237
  _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(&eh->referenceCount);
238
  __gnu_cxx::__atomic_add_dispatch(&eh->referenceCount, 1);
239
  _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(&eh->referenceCount);
234
240
235
  dep->unexpectedHandler = get_unexpected ();
241
  dep->unexpectedHandler = get_unexpected ();
236
  dep->terminateHandler = get_terminate ();
242
  dep->terminateHandler = get_terminate ();
Lines 252-256 std::rethrow_exception(std::exception_ptr ep) Link Here
252
}
258
}
253
259
254
#undef _GLIBCXX_EH_PTR_COMPAT
260
#undef _GLIBCXX_EH_PTR_COMPAT
255
256
#endif
(-)a/libstdc++-v3/libsupc++/exception (-2 / +1 lines)
Lines 35-41 Link Here
35
#pragma GCC visibility push(default)
35
#pragma GCC visibility push(default)
36
36
37
#include <bits/c++config.h>
37
#include <bits/c++config.h>
38
#include <bits/atomic_lockfree_defines.h>
39
#include <bits/exception.h>
38
#include <bits/exception.h>
40
39
41
extern "C++" {
40
extern "C++" {
Lines 139-145 _GLIBCXX_END_NAMESPACE_VERSION Link Here
139
138
140
#pragma GCC visibility pop
139
#pragma GCC visibility pop
141
140
142
#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1)
141
#if (__cplusplus >= 201103L)
143
#include <bits/exception_ptr.h>
142
#include <bits/exception_ptr.h>
144
#include <bits/nested_exception.h>
143
#include <bits/nested_exception.h>
145
#endif
144
#endif
(-)a/libstdc++-v3/libsupc++/exception_ptr.h (-4 lines)
Lines 39-48 Link Here
39
#include <typeinfo>
39
#include <typeinfo>
40
#include <new>
40
#include <new>
41
41
42
#if ATOMIC_INT_LOCK_FREE < 2
43
#  error This platform does not support exception propagation.
44
#endif
45
46
extern "C++" {
42
extern "C++" {
47
43
48
namespace std 
44
namespace std 
(-)a/libstdc++-v3/libsupc++/nested_exception.cc (-2 lines)
Lines 25-31 Link Here
25
25
26
namespace std 
26
namespace std 
27
{
27
{
28
#if ATOMIC_INT_LOCK_FREE > 1
29
  nested_exception::~nested_exception() noexcept = default;
28
  nested_exception::~nested_exception() noexcept = default;
30
#endif
31
} // namespace std
29
} // namespace std
(-)a/libstdc++-v3/libsupc++/nested_exception.h (-5 lines)
Lines 39-48 Link Here
39
#include <bits/c++config.h>
39
#include <bits/c++config.h>
40
#include <bits/move.h>
40
#include <bits/move.h>
41
41
42
#if ATOMIC_INT_LOCK_FREE < 2
43
#  error This platform does not support exception propagation.
44
#endif
45
46
extern "C++" {
42
extern "C++" {
47
43
48
namespace std
44
namespace std
49
- 

Return to bug 64735