@@ -1425,7 +1425,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
class __future_base::_Async_state_common : public __future_base::_State_base
{
protected:
+#ifdef _GLIBCXX_HAVE_TLS
~_Async_state_common();
+#else
+ ~_Async_state_common() { _M_join(); }
+#endif
// Allow non-timed waiting functions to block until the thread completes,
// as if joined.
@@ -85,11 +85,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__future_base::_State_base::~_State_base() = default;
+#ifdef _GLIBCXX_HAVE_TLS
__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
+#endif
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std